From e7c55c9968f746b9e43be90aa13e1d5cdae40ec5 Mon Sep 17 00:00:00 2001 From: IssaIan Date: Wed, 5 Jun 2019 12:21:30 +0300 Subject: [PATCH] bg(Fix password reset): Fix url sent to the user's email address - Make changes [starts #166465376] --- authors/apps/authentication/urls.py | 2 +- authors/apps/authentication/views.py | 4 ++-- authors/settings.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/authors/apps/authentication/urls.py b/authors/apps/authentication/urls.py index 728a6c5..f2210b9 100644 --- a/authors/apps/authentication/urls.py +++ b/authors/apps/authentication/urls.py @@ -18,7 +18,7 @@ path('users/oauth/', SocialAuthAPIView.as_view(), name='social'), path('users/password/reset/', PasswordResetView.as_view(), name='password_reset'), - path('users/password/reset/confirm/', + path('users/password/reset/confirm/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'), path('users/activate/', SignupEmailVerificationView.as_view(), name='signup_verification'), diff --git a/authors/apps/authentication/views.py b/authors/apps/authentication/views.py index e37958e..59a21da 100644 --- a/authors/apps/authentication/views.py +++ b/authors/apps/authentication/views.py @@ -193,11 +193,11 @@ class PasswordResetConfirmView(GenericAPIView): permission_classes = (AllowAny,) serializer_class = PasswordResetConfirmSerializer - def post(self, request): + def post(self, request, **kwargs): request.POST._mutable = True data = request.data token, password = ( - request.GET.get("token"), + kwargs['token'], data.get("password") ) data["token"] = token diff --git a/authors/settings.py b/authors/settings.py index db0ccf0..916bc45 100644 --- a/authors/settings.py +++ b/authors/settings.py @@ -274,7 +274,7 @@ } } } -PASSWORD_RESET_URL_PREFIX = '{}/api/users/password/reset/confirm/?token='.format( +PASSWORD_RESET_URL_PREFIX = '{}/resetconfirm/'.format( DOMAIN) EMAIL_BACKEND = os.getenv('EMAIL_BACKEND') EMAIL_HOST = os.getenv('EMAIL_HOST')