def clean_ad_netbiosname(self): netbiosname = self.cleaned_data.get("ad_netbiosname") try: validate_netbios_names(netbiosname) except Exception as e: raise forms.ValidationError(e) return netbiosname
def clean_nt4_netbiosname(self): netbiosname = self.cleaned_data.get("nt4_netbiosname") try: validate_netbios_names(netbiosname) except Exception as e: raise forms.ValidationError(_("netbiosname: %s" % e)) return netbiosname
def clean_ldap_netbiosname_a(self): netbiosname = self.cleaned_data.get("ldap_netbiosname_a") try: validate_netbios_names(netbiosname) except Exception as e: raise forms.ValidationError(e) return netbiosname
def clean_ad_netbiosname_b(self): netbiosname_a = self.cleaned_data.get("ad_netbiosname") netbiosname = self.cleaned_data.get("ad_netbiosname_b") if not netbiosname: return netbiosname if netbiosname_a and netbiosname_a == netbiosname: raise forms.ValidationError( _('NetBIOS cannot be the same as the first.')) try: validate_netbios_names(netbiosname) except Exception as e: raise forms.ValidationError(e) return netbiosname
def clean_ldap_netbiosname_b(self): netbiosname_a = self.cleaned_data.get("ldap_netbiosname_a") netbiosname = self.cleaned_data.get("ldap_netbiosname_b") if not netbiosname: return netbiosname if netbiosname_a and netbiosname_a == netbiosname: raise forms.ValidationError( _('NetBIOS cannot be the same as the first.')) try: validate_netbios_names(netbiosname) except Exception as e: raise forms.ValidationError(e) return netbiosname