From: Charles Connell Date: Fri, 24 Jan 2014 04:34:21 +0000 (-0500) Subject: Allow users to decide their username on account creation #303 X-Git-Tag: release-20150131~206 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b3e9fe27f2b0de7adeacab1c9db847e7123c1dd0;p=oweals%2Fkarmaworld.git Allow users to decide their username on account creation #303 --- diff --git a/karmaworld/apps/users/forms.py b/karmaworld/apps/users/forms.py index ee12d51..ac7e9a7 100644 --- a/karmaworld/apps/users/forms.py +++ b/karmaworld/apps/users/forms.py @@ -5,11 +5,13 @@ from django import forms class SignupForm(forms.Form): + username = forms.CharField(max_length=255, required=True, label='Username') first_name = forms.CharField(max_length=255, required=False, label='Given name') last_name = forms.CharField(max_length=255, required=False, label='Family name') email = forms.EmailField(label='Email address') def save(self, user): + user.username = self.cleaned_data['username'] user.first_name = self.cleaned_data['first_name'] user.last_name = self.cleaned_data['last_name'] user.email = self.cleaned_data['email'] diff --git a/karmaworld/settings/common.py b/karmaworld/settings/common.py index f8853e9..ba16684 100644 --- a/karmaworld/settings/common.py +++ b/karmaworld/settings/common.py @@ -266,7 +266,7 @@ ACCOUNT_AUTHENTICATION_METHOD = "email" ACCOUNT_CONFIRM_EMAIL_ON_GET = False ACCOUNT_EMAIL_VERIFICATION = "optional" ACCOUNT_EMAIL_SUBJECT_PREFIX = "KarmaNotes.org -- " -ACCOUNT_USERNAME_REQUIRED = False +ACCOUNT_USERNAME_REQUIRED = True SOCIALACCOUNT_EMAIL_REQUIRED = True SOCIALACCOUNT_EMAIL_VERIFICATION = "optional" SOCIALACCOUNT_QUERY_EMAIL = True