Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#14199 closed (fixed)

NameError in django.core.cache.backends.db

Reported by: tiliv Owned by: nobody
Component: Core (Cache system) Version: master
Severity: Keywords: db, cache, NameError
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

Lines 127 and 129 in django/core/cache/backends/db.py (http://code.djangoproject.com/browser/django/trunk/django/core/cache/backends/db.py?rev=13473#L127) cause a NameError when executed.

r13473 introduced an update to allow the new Router system to handle the database cache table name, changing the CacheClass variable handling from self._table to the local variable table, derived from table = connections[db].ops.quote_name(self._table). The _cull method in CacheClass must have been missed, as it tries to use the local table variable without first deriving it.

Attachments (1)

patch.diff (593 bytes) - added by tiliv 5 years ago.
Adds a line to derive local table var

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by tiliv

Adds a line to derive local table var

comment:1 Changed 5 years ago by russellm

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

(In [13678]) Fixed #14199 -- Added a missing table creation statement in the db cache backend cull implementation, and added tests for cache culling. Thanks to Tim for the report.

comment:2 Changed 5 years ago by russellm

(In [13679]) [1.2.X] Fixed #14199 -- Added a missing table creation statement in the db cache backend cull implementation, and added tests for cache culling. Thanks to Tim for the report.

Backport of r13678 from trunk.

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