diff --git a/utils/forms.py b/utils/forms.py index f4588654..1559b325 100644 --- a/utils/forms.py +++ b/utils/forms.py @@ -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(),