Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #17506 -- Did a minor optimization in the sessions' database ba…

…ckend. Thanks to FunkyBob for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 804bd403838dbd01154f8f477b0ebf2045e7b4b5 1 parent 752a43e
Julien Phalip jphalip authored
Showing with 1 addition and 5 deletions.
  1. +1 −5 django/contrib/sessions/backends/db.py
6 django/contrib/sessions/backends/db.py
View
@@ -24,11 +24,7 @@ def load(self):
return {}
def exists(self, session_key):
- try:
- Session.objects.get(session_key=session_key)
- except Session.DoesNotExist:
- return False
- return True
+ return Session.objects.filter(session_key=session_key).exists()
def create(self):
while True:
Please sign in to comment.
Something went wrong with that request. Please try again.