From d4fdc952aa1d213cae2b4af0b161832cb3d6e74c Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 5 May 2023 20:26:53 +0200 Subject: [PATCH] Only add 'Anmelden' item to nav if user is not authenticated --- shiftregister/app/signals.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shiftregister/app/signals.py b/shiftregister/app/signals.py index 8fa7f33..d882bb3 100644 --- a/shiftregister/app/signals.py +++ b/shiftregister/app/signals.py @@ -45,6 +45,9 @@ def populate_app_nav(sender, **kwargs): request = sender nav_items = [] + if request.user.is_authenticated: + return nav_items + helper = request.helper if helper is None: nav_items.append({"link": reverse("register"), "text": "Anmelden"})