Domain display fixes

This commit is contained in:
Sebastian Lohff 2017-04-04 02:53:25 +02:00
parent 2bda17a6e1
commit 93da6a1c41
2 changed files with 10 additions and 4 deletions

View File

@ -75,6 +75,10 @@ class NameserverForm(MntFormMixin, WhoisObjectFormMixin, forms.ModelForm):
if not name.endswith("."):
name += "."
# allow name to stay if it did not change
if not self._create and self.instance.name == name:
return name
if name.count(".") <= 2:
raise forms.ValidationError("Nameserver must be inside a domain (e.g. ns1.noot.dn.)")
@ -138,6 +142,10 @@ class ReverseZoneForm(forms.ModelForm):
model = ReverseZone
fields = ['parentNet', 'nameservers']
help_texts = {
"prefix": "The prefix in CIDR form for which this object is responsible",
}
def __init__(self, user, *args, **kwargs):
self._user = user
@ -157,8 +165,6 @@ class ReverseZoneForm(forms.ModelForm):
self.fields['nameservers'].queryset.distinct()
def clean(self):
cleaned_data = super(ReverseZoneForm, self).clean()

View File

@ -72,10 +72,10 @@
{% for reversezone in reversezones %}
<tr>
<td><a href="{% url "domains:reversezone-show" reversezone.pk %}">{{ reversezone.prefix }}</a></td>
<td></td>
<td>{{ reversezone.parentNet|linkObject }}</td>
<td>
<ul>
{% for nameserver in domain.nameservers.all %}
{% for nameserver in reversezone.nameservers.all %}
<li>{{ nameserver|linkObject }}</li>
{% endfor %}
</ul>