Add function mass clear user/team sessions

bulk-clear-sessions
Kevin Chung 2020-05-04 03:44:02 -04:00
parent bd4900b896
commit e65d60bed1
1 changed files with 12 additions and 0 deletions

View File

@ -58,7 +58,19 @@ def clear_user_session(user_id):
cache.delete_memoized(get_user_attrs, user_id=user_id) cache.delete_memoized(get_user_attrs, user_id=user_id)
def clear_all_user_sessions():
from CTFd.utils.user import get_user_attrs
cache.delete_memoized(get_user_attrs)
def clear_team_session(team_id): def clear_team_session(team_id):
from CTFd.utils.user import get_team_attrs from CTFd.utils.user import get_team_attrs
cache.delete_memoized(get_team_attrs, team_id=team_id) cache.delete_memoized(get_team_attrs, team_id=team_id)
def clear_all_team_sessions():
from CTFd.utils.user import get_team_attrs
cache.delete_memoized(get_team_attrs)