replace hardcoded path ../ to reverse_lazy URL

This commit is contained in:
Benbb96 2024-05-07 15:50:51 +02:00
parent 2d561d15c8
commit b1316214c7
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View File

@ -36,7 +36,9 @@
</div>
</div>
<input class="btn btn-lg btn-primary btn-block" type='submit' value='{% trans "Login" %}' />
<input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}../{% endif %}" />
{% if next %}
<input type="hidden" name="next" value="{{ next }}" />
{% endif %}
{% csrf_token %}</form>
</div>
</div>

View File

@ -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",
),