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."}) "is PTR."})
zone_name = forms.CharField(max_length=100) zone_name = forms.CharField(max_length=100)
record_data = CustomStringPeriodSuffix(required=True) 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(), key_name = forms.ModelChoiceField(queryset=Key.objects.all(),
required=False, required=False,
widget=forms.RadioSelect, 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) this_server = get_object_or_404(models.BindServer, hostname=dns_server)
if request.method == 'POST': 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) form = forms.FormAddForwardRecord(request.POST)
if form.is_valid(): if form.is_valid():
form_cleaned = form.cleaned_data form_cleaned = form.cleaned_data