Add clean_name method for BillingAddressFormSignup
This commit is contained in:
parent
e46729ee04
commit
ddd90e650b
1 changed files with 8 additions and 0 deletions
|
@ -175,6 +175,14 @@ class BillingAddressFormSignup(BillingAddressForm):
|
|||
except CustomUser.DoesNotExist:
|
||||
return email
|
||||
|
||||
def clean_name(self):
|
||||
name = self.cleaned_data.get('name')
|
||||
try:
|
||||
validate_name(name)
|
||||
except ValidationError as ve:
|
||||
raise forms.ValidationError(_("Improper Name"))
|
||||
return name
|
||||
|
||||
|
||||
class UserBillingAddressForm(forms.ModelForm):
|
||||
user = forms.ModelChoiceField(queryset=CustomUser.objects.all(),
|
||||
|
|
Loading…
Reference in a new issue