Optimized SessionBase.get_expire_at_browser_close().

This commit is contained in:
Adam Johnson 2021-11-29 16:57:34 +00:00 committed by Mariusz Felisiak
parent 436862787c
commit c920387fab
1 changed files with 2 additions and 2 deletions

View File

@ -275,9 +275,9 @@ class SessionBase:
``get_expiry_date()`` or ``get_expiry_age()`` to find the actual expiry
date/age, if there is one.
"""
if self.get('_session_expiry') is None:
if (expiry := self.get('_session_expiry')) is None:
return settings.SESSION_EXPIRE_AT_BROWSER_CLOSE
return self.get('_session_expiry') == 0
return expiry == 0
def flush(self):
"""