Browse Source

Check that the reverse DNS entries end with a '.'

Baptiste Jonglez 11 years ago
parent
commit
fb2c41b8e0
1 changed files with 4 additions and 0 deletions
  1. 4 0
      coin/reverse_dns/models.py

+ 4 - 0
coin/reverse_dns/models.py

@@ -26,6 +26,10 @@ class ReverseDNSEntry(models.Model):
     objects = NetManager()
 
     def clean(self):
+        if self.reverse:
+            # Check that the reverse ends with a "." (add it if necessary)
+            if not self.reverse.endswith('.'):
+                self.reverse += '.'
         if self.ip:
             if not self.ip in self.ip_subnet.inet:
                 raise ValidationError('IP address must be included in the IP subnet.')