From b1316214c7805ca71754f5d504e5ac40a8886cc0 Mon Sep 17 00:00:00 2001 From: Benbb96 Date: Tue, 7 May 2024 15:50:51 +0200 Subject: [PATCH] replace hardcoded path ../ to reverse_lazy URL --- helpdesk/templates/helpdesk/registration/login.html | 4 +++- helpdesk/urls.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/helpdesk/templates/helpdesk/registration/login.html b/helpdesk/templates/helpdesk/registration/login.html index a6ae234a..f76a493c 100644 --- a/helpdesk/templates/helpdesk/registration/login.html +++ b/helpdesk/templates/helpdesk/registration/login.html @@ -36,7 +36,9 @@ - + {% if next %} + + {% endif %} {% csrf_token %} diff --git a/helpdesk/urls.py b/helpdesk/urls.py index bbccd354..752d40fc 100644 --- a/helpdesk/urls.py +++ b/helpdesk/urls.py @@ -9,7 +9,7 @@ urls.py - Mapping of URL's to our various views. Note we always used NAMED from django.contrib.auth import views as auth_views from django.contrib.auth.decorators import login_required -from django.urls import include, path, re_path +from django.urls import include, path, re_path, reverse_lazy from django.views.generic import TemplateView from helpdesk import settings as helpdesk_settings from helpdesk.decorators import helpdesk_staff_member_required, protect_view @@ -215,7 +215,7 @@ urlpatterns += [ path( "logout/", auth_views.LogoutView.as_view( - template_name="helpdesk/registration/login.html", next_page="../" + template_name="helpdesk/registration/login.html", next_page=reverse_lazy("helpdesk:home") ), name="logout", ),