mirror of
https://github.com/django/django.git
synced 2025-07-19 00:59:17 +00:00
[1.0.X] Fixed #9548 -- Correctly detect existence of empty sessions with cache backend.
Backport of r9934 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9935 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
3fc72ca8a8
commit
4d2de7a307
@ -43,7 +43,7 @@ class SessionStore(SessionBase):
|
||||
raise CreateError
|
||||
|
||||
def exists(self, session_key):
|
||||
if self._cache.get(session_key):
|
||||
if self._cache.has_key(session_key):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -156,6 +156,11 @@ False
|
||||
False
|
||||
>>> cache_session.items() == prev_data
|
||||
True
|
||||
>>> cache_session = CacheSession()
|
||||
>>> cache_session.save()
|
||||
>>> key = cache_session.session_key
|
||||
>>> cache_session.exists(key)
|
||||
True
|
||||
|
||||
>>> Session.objects.filter(pk=cache_session.session_key).delete()
|
||||
>>> cache_session = CacheSession(cache_session.session_key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user