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 +-- templates/registration/base_admin.html | 55 +++++++++++++++++++++++---------- templates/registration/base_client.html | 26 +++++++++------- version.txt | 2 +- 4 files changed, 57 insertions(+), 31 deletions(-) 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 diff --git a/templates/registration/base_admin.html b/templates/registration/base_admin.html index 8dde1b0..c24255b 100644 --- a/templates/registration/base_admin.html +++ b/templates/registration/base_admin.html @@ -5,6 +5,7 @@ {% load static %} + {% load app_filter %}