Skip to content
Snippets Groups Projects
Commit 76b0ed0a authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[ui] patched registration forms in case of invalid godfather (blocked status)

parent b5eaa6b6
No related branches found
No related tags found
1 merge request!224Security accounts
......@@ -107,6 +107,8 @@ class RegistrationForm(forms.Form):
"""
try:
user = User.objects.get(username__iexact=self.cleaned_data['godfather'])
if user.profile.status == Profile.BLOCKED:
raise forms.ValidationError(_(u'This user is not a valid godfather. Please choose another.'))
except User.DoesNotExist:
raise forms.ValidationError(_(u'This godfather username does not exist. Please choose another.'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment