diff --git a/rest_auth/registration/urls.py b/rest_auth/registration/urls.py index d5504c5d..8f4d0a28 100644 --- a/rest_auth/registration/urls.py +++ b/rest_auth/registration/urls.py @@ -18,6 +18,6 @@ # If you don't want to use API on that step, then just use ConfirmEmailView # view from: # django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py#L190 - url(r'^account-confirm-email/(?P\w+)/$', TemplateView.as_view(), + url(r'^account-confirm-email/(?P[-:\w]+)/$', TemplateView.as_view(), name='account_confirm_email'), ] diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index a5bf2f49..3a205aa7 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -58,6 +58,7 @@ def perform_create(self, serializer): self.token = jwt_encode(user) else: create_token(self.token_model, user, serializer) + complete_signup(self.request._request, user, allauth_settings.EMAIL_VERIFICATION, None) diff --git a/rest_auth/tests/test_api.py b/rest_auth/tests/test_api.py index e966d3f7..a24e9f00 100644 --- a/rest_auth/tests/test_api.py +++ b/rest_auth/tests/test_api.py @@ -419,7 +419,8 @@ def test_registration_with_invalid_password(self): @override_settings( ACCOUNT_EMAIL_VERIFICATION='mandatory', - ACCOUNT_EMAIL_REQUIRED=True + ACCOUNT_EMAIL_REQUIRED=True, + ACCOUNT_EMAIL_CONFIRMATION_HMAC=False ) def test_registration_with_email_verification(self): user_count = get_user_model().objects.all().count() diff --git a/rest_auth/tests/test_social.py b/rest_auth/tests/test_social.py index 9356acdf..56bdace1 100644 --- a/rest_auth/tests/test_social.py +++ b/rest_auth/tests/test_social.py @@ -222,7 +222,8 @@ def test_twitter_social_auth_no_adapter(self): @override_settings( ACCOUNT_EMAIL_VERIFICATION='mandatory', ACCOUNT_EMAIL_REQUIRED=True, - REST_SESSION_LOGIN=False + REST_SESSION_LOGIN=False, + ACCOUNT_EMAIL_CONFIRMATION_HMAC=False ) def test_edge_case(self): resp_body = { diff --git a/rest_auth/tests/urls.py b/rest_auth/tests/urls.py index c33d3900..63712185 100644 --- a/rest_auth/tests/urls.py +++ b/rest_auth/tests/urls.py @@ -43,7 +43,7 @@ class TwitterLoginNoAdapter(SocialLoginView): url(r'^test-admin/', include(django_urls)), url(r'^account-email-verification-sent/$', TemplateView.as_view(), name='account_email_verification_sent'), - url(r'^account-confirm-email/(?P\w+)/$', TemplateView.as_view(), + url(r'^account-confirm-email/(?P[-:\w]+)/$', TemplateView.as_view(), name='account_confirm_email'), url(r'^social-login/facebook/$', FacebookLogin.as_view(), name='fb_login'), url(r'^social-login/twitter/$', TwitterLogin.as_view(), name='tw_login'),