Ticket #17506: session_db.patch

File session_db.patch, 581 bytes (added by FunkyBob, 4 years ago)
  • django/contrib/sessions/backends/db.py

     
    2424            return {}
    2525
    2626    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        Session.objects.filter(session_key=session_key).exists()
    3228
    3329    def create(self):
    3430        while True:
Back to Top