Allow users to decide their username on account creation #303
authorCharles Connell <charles@connells.org>
Fri, 24 Jan 2014 04:34:21 +0000 (23:34 -0500)
committerCharles Connell <charles@connells.org>
Fri, 24 Jan 2014 04:37:36 +0000 (23:37 -0500)
karmaworld/apps/users/forms.py
karmaworld/settings/common.py

index ee12d5161c6ed910493d58e3e60e02b25afa00d1..ac7e9a73af49d752356b675761c1307a2fc70384 100644 (file)
@@ -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']
index f8853e9eb57862fa2803ea3ca12e4d87f841bf41..ba16684d45fc5a2c27c99621dd24dfe2e1f6a776 100644 (file)
@@ -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