Fix access to nameservers

This commit is contained in:
Sebastian Lohff 2017-03-28 13:02:46 +02:00
parent 54e34a49b0
commit c21cbcbd53
1 changed files with 4 additions and 0 deletions

View File

@ -82,6 +82,10 @@ class NameserverDetail(LoginRequiredMixin, DetailView):
#context_object_name = "nameserver" #context_object_name = "nameserver"
template_name = "whoisdb/handle_show.html" 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): class NameserverEdit(MntGenericMixin, LoginRequiredMixin, UpdateView):
model = Nameserver model = Nameserver