mirror of https://github.com/JohnHammond/CTFd.git
Add function mass clear user/team sessions
parent
bd4900b896
commit
e65d60bed1
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue