Skip to content

Commit

Permalink
[1.1.X] Corrected merge of r12411 to 1.1.X branch (see r12415).
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12416 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Feb 11, 2010
1 parent f764d7f commit 0e9f155
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/core/cache/backends/db.py
Expand Up @@ -81,7 +81,8 @@ def delete(self, key):
def has_key(self, key):
now = datetime.now().replace(microsecond=0)
cursor = connection.cursor()
cursor.execute("SELECT cache_key FROM %s WHERE cache_key = %%s and expires > %%s" % self._table, [key, now])
cursor.execute("SELECT cache_key FROM %s WHERE cache_key = %%s and expires > %%s" % self._table,
[key, connection.ops.value_to_db_datetime(now)])
return cursor.fetchone() is not None

def _cull(self, cursor, now):
Expand Down

0 comments on commit 0e9f155

Please sign in to comment.