diff --git a/colab/accounts/forms.py b/colab/accounts/forms.py index 68a11e2..f38443a 100644 --- a/colab/accounts/forms.py +++ b/colab/accounts/forms.py @@ -181,7 +181,7 @@ class UserCreationForm(UserForm): 'password_mismatch': _("The two password fields didn't match."), } username = forms.RegexField(label=_("Username"), max_length=30, - regex=r'^[\w.@+-]+$', + regex=r'^[\w]+$', help_text=_(("Required. 30 characters or fewer" ". Letter and digits.")), error_messages={ @@ -251,7 +251,7 @@ class UserCreationForm(UserForm): class UserChangeForm(forms.ModelForm): username = forms.RegexField( - label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$', + label=_("Username"), max_length=30, regex=r'^[\w]+$', help_text=_("Required. 30 characters or fewer. Letters and digits."), error_messages={ 'invalid': _("This value may contain only letters and numbers.")}) diff --git a/colab/accounts/tests/test_forms.py b/colab/accounts/tests/test_forms.py index 6a741fb..6a4af24 100644 --- a/colab/accounts/tests/test_forms.py +++ b/colab/accounts/tests/test_forms.py @@ -64,7 +64,7 @@ class FormTest(TestCase): def test_valid_username(self): form = self.create_form_data('user@email.com', - 'colab123@colab-spb.com') + 'colab123') self.assertTrue(form.is_valid()) def test_not_valid_username(self): @@ -73,7 +73,7 @@ class FormTest(TestCase): self.assertFalse(form.is_valid()) def test_update_valid_username(self): - form = self.create_change_form_data('colab123@colab-spb.com') + form = self.create_change_form_data('colab123') self.assertTrue(form.is_valid()) def test_update_not_valid_username(self): -- libgit2 0.21.2