Show all mnts if only rir/lir mts available
This commit is contained in:
parent
d6176d8756
commit
6557250bc1
|
@ -26,8 +26,10 @@ def createObjectOverview(request):
|
||||||
@login_required
|
@login_required
|
||||||
def dbDashboard(request):
|
def dbDashboard(request):
|
||||||
mnts = request.user.maintainer_set.filter(rir=False, lir=False).all()
|
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()
|
mnts = request.user.maintainer_set.all()
|
||||||
|
|
||||||
hasDelegations = request.user.maintainer_set.filter(Q(rir=True) | Q(lir=True)).count() > 0
|
hasDelegations = request.user.maintainer_set.filter(Q(rir=True) | Q(lir=True)).count() > 0
|
||||||
|
|
||||||
contacts = Contact.objects.filter(mnt_by__in=mnts)
|
contacts = Contact.objects.filter(mnt_by__in=mnts)
|
||||||
|
|
Loading…
Reference in New Issue