Show all mnts if only rir/lir mts available
This commit is contained in:
parent
27e1a35e5a
commit
aec578d619
|
@ -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