Update session_redis/session.py

Co-authored-by: Florent Xicluna <142113+florentx@users.noreply.github.com>
This commit is contained in:
Denis LeemannandFlorent Xicluna authored and GitHub committed 2025-12-15 16:00:21 +01:00
1 parent 9dcbe33366
commit 7375585a5b
1 file changed
+1 -2
+1 -2
View File
@@ -97,9 +97,8 @@ class RedisSessionStore(SessionStore):
"utf-8"
)
if self.redis.set(key, data):
if not isinstance(expiration, int):
if not (expiration and isinstance(expiration, int)):
expiration = DEFAULT_SESSION_TIMEOUT_ANONYMOUS
if expiration == 0:
expiration = DEFAULT_SESSION_TIMEOUT_ANONYMOUS
return self.redis.expire(key, expiration)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.