mirror of https://github.com/django/django.git
Fixed #17506 -- Did a minor optimization in the sessions' database backend. Thanks to FunkyBob for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
752a43e245
commit
804bd40383
|
@ -24,11 +24,7 @@ class SessionStore(SessionBase):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def exists(self, session_key):
|
def exists(self, session_key):
|
||||||
try:
|
return Session.objects.filter(session_key=session_key).exists()
|
||||||
Session.objects.get(session_key=session_key)
|
|
||||||
except Session.DoesNotExist:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in New Issue