def clean(self, value, *args, **kwargs): super(HostnameField, self).clean(value, *args, **kwargs) if value: utils.validate_dns_name(value, hostname=True, error_text=self.error_text) return value
def clean(self, value, *args, **kwargs): value = super(NameField, self).clean(value, *args, **kwargs) if value: utils.validate_dns_name(value, self.hostname) return value