Only show distinct nameservers in domain form
This commit is contained in:
parent
93da6a1c41
commit
c1afcbfa3a
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue