Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Commit

Permalink
Allow hyphen in username. Fixes: 261
Browse files Browse the repository at this point in the history
  • Loading branch information
wunki committed Feb 4, 2013
1 parent 852e7fc commit b1b3ec9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion userena/tests/forms.py
Expand Up @@ -23,7 +23,7 @@ def test_signup_form(self):
'tos': 'on'},
'error': ('username', [u'Username must contain only letters, numbers, dots and underscores.'])},
# Password is not the same
{'data': {'username': 'katy',
{'data': {'username': 'katy-',
'email': 'katy@newexample.com',
'password1': 'foo',
'password2': 'foo2',
Expand Down
18 changes: 9 additions & 9 deletions userena/urls.py
Expand Up @@ -37,7 +37,7 @@
{'template_name': 'userena/password_reset_complete.html'}),

# Signup
url(r'^(?P<username>[\.\w]+)/signup/complete/$',
url(r'^(?P<username>[\.\w-]+)/signup/complete/$',
userena_views.direct_to_user_template,
{'template_name': 'userena/signup_complete.html',
'extra_context': {'userena_activation_required': userena_settings.USERENA_ACTIVATION_REQUIRED,
Expand All @@ -50,14 +50,14 @@
name='userena_activate'),

# Change email and confirm it
url(r'^(?P<username>[\.\w]+)/email/$',
url(r'^(?P<username>[\.\w-]+)/email/$',
userena_views.email_change,
name='userena_email_change'),
url(r'^(?P<username>[\.\w]+)/email/complete/$',
url(r'^(?P<username>[\.\w-]+)/email/complete/$',
userena_views.direct_to_user_template,
{'template_name': 'userena/email_change_complete.html'},
name='userena_email_change_complete'),
url(r'^(?P<username>[\.\w]+)/confirm-email/complete/$',
url(r'^(?P<username>[\.\w-]+)/confirm-email/complete/$',
userena_views.direct_to_user_template,
{'template_name': 'userena/email_confirm_complete.html'},
name='userena_email_confirm_complete'),
Expand All @@ -66,27 +66,27 @@
name='userena_email_confirm'),

# Disabled account
url(r'^(?P<username>[\.\w]+)/disabled/$',
url(r'^(?P<username>[\.\w-]+)/disabled/$',
userena_views.direct_to_user_template,
{'template_name': 'userena/disabled.html'},
name='userena_disabled'),

# Change password
url(r'^(?P<username>[\.\w]+)/password/$',
url(r'^(?P<username>[\.\w-]+)/password/$',
userena_views.password_change,
name='userena_password_change'),
url(r'^(?P<username>[\.\w]+)/password/complete/$',
url(r'^(?P<username>[\.\w-]+)/password/complete/$',
userena_views.direct_to_user_template,
{'template_name': 'userena/password_complete.html'},
name='userena_password_change_complete'),

# Edit profile
url(r'^(?P<username>[\.\w]+)/edit/$',
url(r'^(?P<username>[\.\w-]+)/edit/$',
userena_views.profile_edit,
name='userena_profile_edit'),

# View profiles
url(r'^(?P<username>(?!signout|signup|signin)[\.\w]+)/$',
url(r'^(?P<username>(?!signout|signup|signin)[\.\w-]+)/$',
userena_views.profile_detail,
name='userena_profile_detail'),
url(r'^page/(?P<page>[0-9]+)/$',
Expand Down

0 comments on commit b1b3ec9

Please sign in to comment.