Opened 4 years ago

Closed 4 years ago

#19347 closed Cleanup/optimization (fixed)

Irrelevant line of code in django/middleware/

Reported by: gregplaysguitar@… Owned by: nobody
Component: Core (Other) Version: master
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


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

        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

Change History (2)

comment:1 Changed 4 years ago by claudep

  • Component changed from Uncategorized to Core (Other)
  • Easy pickings set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization

comment:2 Changed 4 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In c0efbc7b534c716fdfba2e5e32a4c41b90f334eb:

Fixed #19347 -- Removed unused variable definition in FetchFromCacheMiddleware

Thanks gregplaysguitar at for the report.

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