From c21cbcbd53ac03483da1db9431da6dc77a3c0eae Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Tue, 28 Mar 2017 13:02:46 +0200 Subject: [PATCH] Fix access to nameservers --- domains/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/domains/views.py b/domains/views.py index 8593a60..ccd94e2 100644 --- a/domains/views.py +++ b/domains/views.py @@ -82,6 +82,10 @@ class NameserverDetail(LoginRequiredMixin, DetailView): #context_object_name = "nameserver" template_name = "whoisdb/handle_show.html" + def get_queryset(self): + mnts = self.request.user.maintainer_set.all() + return self.model.objects.filter(mnt_by__in=mnts).distinct() + class NameserverEdit(MntGenericMixin, LoginRequiredMixin, UpdateView): model = Nameserver