Commits

George Notaras  committed 0d6d6ea

Improved verification that the record names belong to the current zone.

  • Participants
  • Parent commits c325db2

Comments (0)

Files changed (1)

File src/powerdns_manager/forms.py

         
         name = self.cleaned_data.get('name')
         domain = self.cleaned_data.get('domain')
-        if name and domain:
-            if len(name.split('.')) < len(domain.name.split('.')):
-                msg = 'Invalid record name. This name belongs to a parent zone.'
+        if name and domain.name:
+            #if len(name.split('.')) < len(domain.name.split('.')):
+            if not name.endswith(domain.name):
+                msg = 'Invalid record name. This name belongs to a different zone.'
                 self._errors["name"] = self.error_class([msg])
         
         return self.cleaned_data