Opened 11 years ago

Closed 11 years ago

#19347 closed Cleanup/optimization (fixed)

Irrelevant line of code in django/middleware/cache.py

Reported by: gregplaysguitar@… Owned by: nobody
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

This is minor, but could potentially be misleading. Line 129 of django/middleware/cache.py

        self.cache_anonymous_only = getattr(settings, 'CACHE_MIDDLEWARE_ANONYMOUS_ONLY', False)

should be removed, because the self.cache_anonymous_only variable is never used. All of the "anonymous only" logic is in the UpdateCacheMiddleware class. See https://github.com/django/django/blob/master/django/middleware/cache.py#L129

Change History (2)

comment:1 by Claude Paroz, 11 years ago

Component: UncategorizedCore (Other)
Easy pickings: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In c0efbc7b534c716fdfba2e5e32a4c41b90f334eb:

Fixed #19347 -- Removed unused variable definition in FetchFromCacheMiddleware

Thanks gregplaysguitar at gmail.com for the report.

Note: See TracTickets for help on using tickets.
Back to Top