Don't require first and last name fields in OAuth signup
authorMagnus Hagander <magnus@hagander.net>
Mon, 18 Sep 2017 16:32:49 +0000 (18:32 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 18 Sep 2017 16:32:49 +0000 (18:32 +0200)
I had fixed the OAuth process to deal with this case, but failed to
cover the actual new account creation part which still required it. With
this fix, we allow a signup without a name. If the user wishes to set a
full name on the account it can be done on the profile page for the
user, but it's possible to proceed to access restricted resources
without doing it.

Reported by @Smylers2 on twitter, relayed by @TokenScandi

pgweb/account/forms.py

index a8ab5848a6f8ee7de0cbfa41fad51305127391df..e7322ab4e1ce1254cb61af7eae2dfe0ca4d42f4f 100644 (file)
@@ -77,8 +77,8 @@ class SignupForm(forms.Form):
 
 class SignupOauthForm(forms.Form):
        username = forms.CharField(max_length=30)
-       first_name = forms.CharField(max_length=30)
-       last_name = forms.CharField(max_length=30)
+       first_name = forms.CharField(max_length=30, required=False)
+       last_name = forms.CharField(max_length=30, required=False)
        email = forms.EmailField()
        captcha = ReCaptchaField()