From c0264e5dda090c724dad109e744fb2656eb48e18 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 24 Feb 2019 20:35:25 +0100 Subject: [PATCH] Remove LoginRequiredMixin for ResetPassword view As this can be done even when the user is logged out --- dal/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dal/views.py b/dal/views.py index a3f33c5..35fa4d1 100644 --- a/dal/views.py +++ b/dal/views.py @@ -170,8 +170,7 @@ class ChangeData(LoginRequiredMixin, View): return render(request, 'error.html', { 'urlname': urlname, 'service': service, 'error': msg } ) -class ResetPassword(LoginRequiredMixin, View): - login_url = reverse_lazy('login_index') +class ResetPassword(View): def get(self, request): return render(request, 'resetpassword.html') @@ -185,7 +184,7 @@ class ResetPassword(LoginRequiredMixin, View): uid=user, attributes=['uid', 'givenName', 'sn', 'mail'] ) - if user_exists and request.user.username == user: + if user_exists: # user exists, so try to get email # with get_pool().next() as rpc: # (state, tmp1, tmp2, email) = rpc.getuserdata.get_data(user)