Add login_url for all LoginRequiredMixin views

This commit is contained in:
PCoder 2019-02-24 20:34:53 +01:00
parent 14949cedb7
commit a20e9479c8

View file

@ -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')