mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-25 01:13:31 +01:00
fix logout in Django 5 with POST action instead of GET
This commit is contained in:
parent
ba9935e792
commit
6fe5f1681f
@ -58,7 +58,9 @@
|
||||
<a class="dropdown-item" href='{% url 'helpdesk:system_settings' %}'><i class="fas fa-fw fa-cogs"></i> {% trans "System Settings" %}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="{% url 'helpdesk:logout' %}"><i class="fas fa-fw fa-sign-out-alt"></i> {% trans "Logout" %}</a>
|
||||
<form action="{% url 'helpdesk:logout' %}" method="post">{% csrf_token %}
|
||||
<button type="submit" class="dropdown-item"><i class="fas fa-fw fa-sign-out-alt"></i> {% trans "Logout" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
{% else %}
|
||||
@ -82,7 +84,9 @@
|
||||
</div>
|
||||
<li class="nav-item dropdown no-arrow">
|
||||
{% if user.is_authenticated %}
|
||||
<a class="nav-link dropdown-toggle" href="{% url 'helpdesk:logout' %}" id="userDropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fas fa-fw fa-sign-out-alt"></i> {% trans "Logout" %}</a>
|
||||
<form action="{% url 'helpdesk:logout' %}" method="post">{% csrf_token %}
|
||||
<button type="submit" class="nav-link dropdown-toggle" id="userDropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fas fa-fw fa-sign-out-alt"></i> {% trans "Logout" %}</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<a class="nav-link dropdown-toggle" href="{% url 'helpdesk:login' %}?next={% if next %}{{ next|escape }}{% else %}{% url 'helpdesk:home' %}{% endif %}" id="userDropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fas fa-fw fa-sign-in-alt"></i> {% trans "Log In" %}</a>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user