From a20e9479c8b5c43597a17296423a20528921a5fb Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 24 Feb 2019 20:34:53 +0100 Subject: [PATCH] Add login_url for all LoginRequiredMixin views --- dal/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dal/views.py b/dal/views.py index 6f73602..a3f33c5 100644 --- a/dal/views.py +++ b/dal/views.py @@ -97,6 +97,7 @@ class Register(View): return render(request, 'usercreated.html', { 'user': username } ) class ChangeData(LoginRequiredMixin, View): + login_url = reverse_lazy('login_index') # provide the form for the change request def get(self, request): urlname = 'change_data' @@ -344,7 +345,7 @@ class ResetRequest(View): # The logged in user can change the password here class ChangePassword(LoginRequiredMixin, View): - + login_url = reverse_lazy('login_index') # Presents the page for a logged in user def get(self, request): if not request.user.is_authenticated: @@ -394,6 +395,7 @@ class ChangePassword(LoginRequiredMixin, View): # Deletes an account class DeleteAccount(LoginRequiredMixin, View): + login_url = reverse_lazy('login_index') # Show the basic form for deleting an account def get(self, request): return render(request, 'deleteaccount.html')