resurrect the ability to add a PTR record on its own, not as part of a pair of forward records

This commit is contained in:
Jeffrey Forman 2015-12-26 15:14:29 -05:00
parent e9d65179ab
commit 2bb8f5d9cb
2 changed files with 6 additions and 2 deletions

View File

@ -77,7 +77,8 @@ class FormAddReverseRecord(forms.Form):
"is PTR."})
zone_name = forms.CharField(max_length=100)
record_data = CustomStringPeriodSuffix(required=True)
ttl = forms.ChoiceField(choices=settings.TTL_CHOICES)
ttl = forms.ChoiceField(choices=settings.TTL_CHOICES,
widget=forms.RadioSelect)
key_name = forms.ModelChoiceField(queryset=Key.objects.all(),
required=False,
widget=forms.RadioSelect,

View File

@ -65,6 +65,9 @@ def view_add_record(request, dns_server, zone_name):
this_server = get_object_or_404(models.BindServer, hostname=dns_server)
if request.method == 'POST':
if "in-addr.arpa" in zone_name or "ip6.arpa" in zone_name:
form = forms.FormAddReverseRecord(request.POST)
else:
form = forms.FormAddForwardRecord(request.POST)
if form.is_valid():
form_cleaned = form.cleaned_data