From aec578d6193a8d153bbcd3cbd99e1f9ef9ff5380 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Thu, 12 Oct 2017 21:18:24 +0200 Subject: [PATCH] Show all mnts if only rir/lir mts available --- whoisdb/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/whoisdb/views.py b/whoisdb/views.py index 17e4aaf..61c551a 100644 --- a/whoisdb/views.py +++ b/whoisdb/views.py @@ -26,8 +26,10 @@ def createObjectOverview(request): @login_required def dbDashboard(request): mnts = request.user.maintainer_set.filter(rir=False, lir=False).all() - if request.GET.get("delegated", None): + if request.GET.get("delegated", None) or mnts.count() == 0: + # if user wants to see rir/lir objects or only has rir/lir mnts, use all available mnts mnts = request.user.maintainer_set.all() + hasDelegations = request.user.maintainer_set.filter(Q(rir=True) | Q(lir=True)).count() > 0 contacts = Contact.objects.filter(mnt_by__in=mnts)