def clean(self): self.master_domain = _name_to_master_domain(self.name) do_zone_validation(self) if self.pk is None: # The object doesn't exist in the db yet. Make sure we don't # conflict with existing objects. qset = fqdn_exists(self.name, pt=False) if qset: objects = qset.all() raise ValidationError("Objects with this name already " "exist {0}".format(objects))
def clean(self): if self.name.endswith('arpa'): self.is_reverse = True self.master_domain = name_to_master_domain(self.name) do_zone_validation(self) # TODO, can we remove this? if self.pk is None: # The object doesn't exist in the db yet. Make sure we don't # conflict with existing objects. We may want to move to a more # automatic solution where the creation of a new domain will # automatically move objects around (see the ensure_domain # function). qset = smart_fqdn_exists(self.name) if qset: objects = qset.all() raise ValidationError("Objects with this name already " "exist {0}".format(objects))
def clean(self): validate_reverse_name(self.name, self.ip_type) self.name = self.name.lower() self.master_reverse_domain = _name_to_master_reverse_domain(self.name, ip_type=self.ip_type) do_zone_validation(self)