From 3d32b7120f4778a3effda44364f334abbb39b891 Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Tue, 9 Jul 2024 20:12:06 -0300 Subject: [PATCH] Permite iniciar sem nenhum dashboard --- sigi/apps/home/context_processors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sigi/apps/home/context_processors.py b/sigi/apps/home/context_processors.py index 6129188..82fea6f 100644 --- a/sigi/apps/home/context_processors.py +++ b/sigi/apps/home/context_processors.py @@ -43,7 +43,10 @@ def dashboard(request): if request.path != reverse("admin:index"): return {} my_dash = get_or_create_dash(request.user) - selected = request.GET.get("dash", my_dash[0]["slug"]) + if my_dash: + selected = request.GET.get("dash", my_dash[0]["slug"]) + else: + selected = "" return { "sigi_dashes": my_dash, "sigi_dash_selected": selected,