From c1afcbfa3ade4909fbfba89e403c7fa10c761214 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Wed, 5 Apr 2017 02:32:11 +0200 Subject: [PATCH] Only show distinct nameservers in domain form --- domains/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domains/forms.py b/domains/forms.py index 8c37daf..dd3cc9d 100644 --- a/domains/forms.py +++ b/domains/forms.py @@ -29,7 +29,7 @@ class DomainForm(MntFormMixin, WhoisObjectFormMixin, forms.ModelForm): self.fields['name'].disabled = True self.fields['nameservers'].queryset |= self.instance.nameservers.all() - self.fields['nameservers'].queryset.distinct() + self.fields['nameservers'].queryset = self.fields['nameservers'].queryset.distinct() def clean_name(self): name = self.cleaned_data['name'].lower() @@ -163,7 +163,7 @@ class ReverseZoneForm(forms.ModelForm): self.fields['prefix'].disabled = True self.fields['nameservers'].queryset |= self.instance.nameservers.all() - self.fields['nameservers'].queryset.distinct() + self.fields['nameservers'].queryset = self.fields['nameservers'].queryset.distinct() def clean(self): cleaned_data = super(ReverseZoneForm, self).clean()