sessions: Don't filter by expire_date in delete_realm_user_sessions.

The other delete_... functions just do .all() - we should be consistent
one way or another.
This commit is contained in:
Mateusz Mandera 2022-03-27 20:45:12 +02:00 committed by Tim Abbott
parent 003d086f2e
commit 66d8c2ae15
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def delete_user_sessions(user_profile: UserProfile) -> None:
def delete_realm_user_sessions(realm: Realm) -> None: def delete_realm_user_sessions(realm: Realm) -> None:
realm_user_ids = list(UserProfile.objects.filter(realm=realm).values_list("id", flat=True)) realm_user_ids = list(UserProfile.objects.filter(realm=realm).values_list("id", flat=True))
for session in Session.objects.filter(expire_date__gte=timezone_now()): for session in Session.objects.all():
if get_session_user(session) in realm_user_ids: if get_session_user(session) in realm_user_ids:
delete_session(session) delete_session(session)