Skip to content

Commit 9df528f

Browse files
committed
Changed confirm email url path + test fixes
1 parent 0ffc573 commit 9df528f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

rest_auth/registration/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
# If you don't want to use API on that step, then just use ConfirmEmailView
1919
# view from:
2020
# django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py#L190
21-
url(r'^account-confirm-email/(?P<key>\w+)/$', TemplateView.as_view(),
21+
url(r'^account-confirm-email/(?P<key>[-:\w]+)/$', TemplateView.as_view(),
2222
name='account_confirm_email'),
2323
]

rest_auth/registration/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def perform_create(self, serializer):
5858
self.token = jwt_encode(user)
5959
else:
6060
create_token(self.token_model, user, serializer)
61+
6162
complete_signup(self.request._request, user,
6263
allauth_settings.EMAIL_VERIFICATION,
6364
None)

rest_auth/tests/test_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ def test_registration_with_invalid_password(self):
419419

420420
@override_settings(
421421
ACCOUNT_EMAIL_VERIFICATION='mandatory',
422-
ACCOUNT_EMAIL_REQUIRED=True
422+
ACCOUNT_EMAIL_REQUIRED=True,
423+
ACCOUNT_EMAIL_CONFIRMATION_HMAC=False
423424
)
424425
def test_registration_with_email_verification(self):
425426
user_count = get_user_model().objects.all().count()

rest_auth/tests/test_social.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ def test_twitter_social_auth_no_adapter(self):
222222
@override_settings(
223223
ACCOUNT_EMAIL_VERIFICATION='mandatory',
224224
ACCOUNT_EMAIL_REQUIRED=True,
225-
REST_SESSION_LOGIN=False
225+
REST_SESSION_LOGIN=False,
226+
ACCOUNT_EMAIL_CONFIRMATION_HMAC=False
226227
)
227228
def test_edge_case(self):
228229
resp_body = {

rest_auth/tests/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class TwitterLoginNoAdapter(SocialLoginView):
4343
url(r'^test-admin/', include(django_urls)),
4444
url(r'^account-email-verification-sent/$', TemplateView.as_view(),
4545
name='account_email_verification_sent'),
46-
url(r'^account-confirm-email/(?P<key>\w+)/$', TemplateView.as_view(),
46+
url(r'^account-confirm-email/(?P<key>[-:\w]+)/$', TemplateView.as_view(),
4747
name='account_confirm_email'),
4848
url(r'^social-login/facebook/$', FacebookLogin.as_view(), name='fb_login'),
4949
url(r'^social-login/twitter/$', TwitterLogin.as_view(), name='tw_login'),

0 commit comments

Comments
 (0)