Code

Opened 4 years ago

Closed 4 years ago

Last modified 4 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 4 years ago.
Adds a line to derive local table var

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by tiliv

Adds a line to derive local table var

comment:1 Changed 4 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 4 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.