From f1fd732e742b8b1530bf95b8df05d69dfe8c1eb0 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Thu, 24 Mar 2022 12:25:32 +0100 Subject: move all items in dropdown --- accounts/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'accounts') diff --git a/accounts/views.py b/accounts/views.py index 9f7c9b3..67e8911 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -272,14 +272,15 @@ def user_switcher(request): sessions = json.loads(request.COOKIES.get("user_switcher")) sessions[request.user.username] = (request.session.session_key, request.session.get_expiry_date().timestamp()) - set_switch_cookie(response, sessions) if username in sessions: set_session_cookie(response, sessions[username][0], sessions[username][1]) + del sessions[username] else: set_session_cookie(response, "", 0) - print("done") + set_switch_cookie(response, sessions) + return response -- cgit v1.2.1