Commit ddd90e65 authored by PCoder's avatar PCoder

Add clean_name method for BillingAddressFormSignup

parent e46729ee
......@@ -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(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment