Commits

George Notaras committed 742826f

Implemented SPF record validation.

Comments (0)

Files changed (1)

src/powerdns_manager/forms.py

 class SpfRecordModelForm(BaseRecordModelForm):
     """ModelForm for SPF 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 = 'SPF'
         return super(SpfRecordModelForm, self).save(*args, **kwargs)