Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored January 24, 2012

Showing 1 changed file with 1 addition and 5 deletions. Show diff stats Hide diff stats

  1. 6  django/contrib/sessions/backends/db.py
6  django/contrib/sessions/backends/db.py
@@ -24,11 +24,7 @@ def load(self):
24 24
             return {}
25 25
 
26 26
     def exists(self, session_key):
27  
-        try:
28  
-            Session.objects.get(session_key=session_key)
29  
-        except Session.DoesNotExist:
30  
-            return False
31  
-        return True
  27
+        return Session.objects.filter(session_key=session_key).exists()
32 28
 
33 29
     def create(self):
34 30
         while True:

0 notes on commit 804bd40

Please sign in to comment.
Something went wrong with that request. Please try again.