Commits

George Notaras committed 6a48bb6

Implemented SRV record validation.

Comments (0)

Files changed (1)

src/powerdns_manager/forms.py

                     }
         super(SrvRecordModelForm, self).__init__(*args, **kwargs)
     
+    def clean_name(self):
+        name = self.cleaned_data.get('name')
+        validate_hostname(name)
+        return name
+    
+    def clean_target(self):
+        target = self.cleaned_data.get('target')
+        validate_hostname(target)
+        return target
+    
     def save(self, *args, **kwargs):
         self.instance.type = 'SRV'
         self.instance.content = '%d %d %s' % (