예제 #1
0
파일: forms.py 프로젝트: vanloswang/freenas
 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
예제 #2
0
파일: forms.py 프로젝트: vanloswang/freenas
 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
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
파일: forms.py 프로젝트: vanloswang/freenas
 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
예제 #6
0
 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