Skip to content

Commit

Permalink
Changed confirm email url path + test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mariodev committed Jul 28, 2016
1 parent 0ffc573 commit 9df528f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rest_auth/registration/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<key>\w+)/$', TemplateView.as_view(),
url(r'^account-confirm-email/(?P<key>[-:\w]+)/$', TemplateView.as_view(),
name='account_confirm_email'),
]
1 change: 1 addition & 0 deletions rest_auth/registration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion rest_auth/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion rest_auth/tests/test_social.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion rest_auth/tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<key>\w+)/$', TemplateView.as_view(),
url(r'^account-confirm-email/(?P<key>[-:\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'),
Expand Down

0 comments on commit 9df528f

Please sign in to comment.