Browse Source

Allow NS description to be empty

Baptiste Jonglez 11 years ago
parent
commit
118c362adf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      coin/reverse_dns/models.py

+ 2 - 2
coin/reverse_dns/models.py

@@ -10,12 +10,12 @@ REGEX = r'(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}
 class NameServer(models.Model):
     dns_name = models.CharField(max_length=255,
                                 help_text="Example: ns1.example.com")
-    description = models.CharField(max_length=255,
+    description = models.CharField(max_length=255, blank=True,
                                    verbose_name="human-readable name of the nameserver",
                                    help_text="Example: My first name server")
 
     def __unicode__(self):
-        return "{} ({})".format(self.description, self.dns_name)
+        return "{} ({})".format(self.description, self.dns_name) if self.description else self.dns_name
 
 
 class ReverseDNSEntry(models.Model):