summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAmar <100243770+aadeina@users.noreply.github.com>2026-02-03 00:34:04 +0000
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-21 09:57:49 -0500
commit158fd81ef5a5647d27eb3065063284f9ee0a3ca4 (patch)
treec6a2bc932dd9d54fb6eb25be7a4e8299babeb0e5 /django
parente85db77e11e37d6ec82526557c4dafe4b30dc699 (diff)
Fixed #36899 -- Implemented SessionBase.__bool__.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/sessions/backends/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/contrib/sessions/backends/base.py b/django/contrib/sessions/backends/base.py
index e53f1d201a..8f673761f2 100644
--- a/django/contrib/sessions/backends/base.py
+++ b/django/contrib/sessions/backends/base.py
@@ -66,6 +66,9 @@ class SessionBase:
del self._session[key]
self.modified = True
+ def __bool__(self):
+ return not self.is_empty()
+
@property
def key_salt(self):
return "django.contrib.sessions." + self.__class__.__qualname__