Follow-up Ibddffc5f: Also allow PTR records pointing to the domain itself
Bug: #1597989 Change-Id: Ie13e47e03afd4e95621bfb5f36b8e79e78643b11
This commit is contained in:
parent
2669ea575d
commit
3afaf1ff64
@ -395,9 +395,9 @@ class RecordForm(forms.SelfHandlingForm):
|
||||
|
||||
# Name field
|
||||
if self._is_field_blank(cleaned_data, 'name'):
|
||||
if record_type in ['CNAME', 'SRV', 'PTR']:
|
||||
if record_type in ['CNAME', 'SRV']:
|
||||
self._add_required_field_error('name')
|
||||
elif record_type in ['MX', 'A', 'AAAA', 'TXT']:
|
||||
elif record_type in ['MX', 'A', 'AAAA', 'TXT', 'PTR']:
|
||||
cleaned_data['name'] = domain_name
|
||||
else:
|
||||
if record_type == 'SRV':
|
||||
|
@ -37,7 +37,8 @@ class PTRRecordFormTests(base.BaseRecordFormCleanTests):
|
||||
def test_missing_name_field(self):
|
||||
self.form.cleaned_data['name'] = ''
|
||||
self.form.clean()
|
||||
self.assert_required_error('name')
|
||||
self.assert_no_errors()
|
||||
self.assertIsNotNone(self.form.cleaned_data['name'])
|
||||
|
||||
def test_invalid_name_field(self):
|
||||
self.form.cleaned_data['name'] = '#@$foo!!'
|
||||
|
Loading…
Reference in New Issue
Block a user