Commits

George Notaras  committed 54d8ed8

Implemented TXT record validation.

  • Participants
  • Parent commits dec8b0b

Comments (0)

Files changed (1)

File src/powerdns_manager/forms.py

 class TxtRecordModelForm(BaseRecordModelForm):
     """ModelForm for TXT resource records."""
 
+    def clean_name(self):
+        name = self.cleaned_data.get('name')
+        validate_hostname(name, supports_wildcard=True)
+        return name
+    
     def save(self, *args, **kwargs):
         self.instance.type = 'TXT'
         return super(TxtRecordModelForm, self).save(*args, **kwargs)