mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 17:16:34 +03:00
Changed confirm email url path + test fixes
This commit is contained in:
parent
0ffc573482
commit
9df528f482
|
@ -18,6 +18,6 @@ urlpatterns = [
|
||||||
# If you don't want to use API on that step, then just use ConfirmEmailView
|
# If you don't want to use API on that step, then just use ConfirmEmailView
|
||||||
# view from:
|
# view from:
|
||||||
# django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py#L190
|
# 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'),
|
name='account_confirm_email'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -58,6 +58,7 @@ class RegisterView(CreateAPIView):
|
||||||
self.token = jwt_encode(user)
|
self.token = jwt_encode(user)
|
||||||
else:
|
else:
|
||||||
create_token(self.token_model, user, serializer)
|
create_token(self.token_model, user, serializer)
|
||||||
|
|
||||||
complete_signup(self.request._request, user,
|
complete_signup(self.request._request, user,
|
||||||
allauth_settings.EMAIL_VERIFICATION,
|
allauth_settings.EMAIL_VERIFICATION,
|
||||||
None)
|
None)
|
||||||
|
|
|
@ -419,7 +419,8 @@ class APITestCase1(TestCase, BaseAPITestCase):
|
||||||
|
|
||||||
@override_settings(
|
@override_settings(
|
||||||
ACCOUNT_EMAIL_VERIFICATION='mandatory',
|
ACCOUNT_EMAIL_VERIFICATION='mandatory',
|
||||||
ACCOUNT_EMAIL_REQUIRED=True
|
ACCOUNT_EMAIL_REQUIRED=True,
|
||||||
|
ACCOUNT_EMAIL_CONFIRMATION_HMAC=False
|
||||||
)
|
)
|
||||||
def test_registration_with_email_verification(self):
|
def test_registration_with_email_verification(self):
|
||||||
user_count = get_user_model().objects.all().count()
|
user_count = get_user_model().objects.all().count()
|
||||||
|
|
|
@ -222,7 +222,8 @@ class TestSocialAuth(TestCase, BaseAPITestCase):
|
||||||
@override_settings(
|
@override_settings(
|
||||||
ACCOUNT_EMAIL_VERIFICATION='mandatory',
|
ACCOUNT_EMAIL_VERIFICATION='mandatory',
|
||||||
ACCOUNT_EMAIL_REQUIRED=True,
|
ACCOUNT_EMAIL_REQUIRED=True,
|
||||||
REST_SESSION_LOGIN=False
|
REST_SESSION_LOGIN=False,
|
||||||
|
ACCOUNT_EMAIL_CONFIRMATION_HMAC=False
|
||||||
)
|
)
|
||||||
def test_edge_case(self):
|
def test_edge_case(self):
|
||||||
resp_body = {
|
resp_body = {
|
||||||
|
|
|
@ -43,7 +43,7 @@ urlpatterns += [
|
||||||
url(r'^test-admin/', include(django_urls)),
|
url(r'^test-admin/', include(django_urls)),
|
||||||
url(r'^account-email-verification-sent/$', TemplateView.as_view(),
|
url(r'^account-email-verification-sent/$', TemplateView.as_view(),
|
||||||
name='account_email_verification_sent'),
|
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'),
|
name='account_confirm_email'),
|
||||||
url(r'^social-login/facebook/$', FacebookLogin.as_view(), name='fb_login'),
|
url(r'^social-login/facebook/$', FacebookLogin.as_view(), name='fb_login'),
|
||||||
url(r'^social-login/twitter/$', TwitterLogin.as_view(), name='tw_login'),
|
url(r'^social-login/twitter/$', TwitterLogin.as_view(), name='tw_login'),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user