Skip to content

Commit

Permalink
logout fix #85
Browse files Browse the repository at this point in the history
  • Loading branch information
1modm committed Feb 27, 2024
1 parent 2391513 commit 8d13742
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/preport/templates/home/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n%}
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 1.4.2
<b>Version</b> 1.4.3
</div>
<strong>BSD 3-Clause Copyright &copy; {% now "Y" %} <a href="https://github.com/1modm/petereport">PeTeReport</a></strong> {% translate "All rights reserved." %}
</footer>
Expand Down
11 changes: 7 additions & 4 deletions app/preport/templates/home/top_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@
</li>

<li class="nav-item">
<a class="nav-link" href="/accounts/logout/" role="button">
<i class="fas fa-sign-out-alt"></i> {% translate "Logout" %} {{ request.user }} {% translate "session" %}
</a>
<form id="logout-form" method="post" action="{% url 'logout' %}">
{% csrf_token %}
<a class="nav-link" role="button" href="#" onclick="document.getElementById('logout-form').submit(); return false;">
<i class="fas fa-sign-out-alt"></i> {% translate "Logout" %} {{ request.user }} {% translate "session" %}
</a>
</form>
</li>

</ul>

</nav>
2 changes: 1 addition & 1 deletion app/preport/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def markdown_uploader(request):
Makdown image upload for locale storage
and represent as json to markdown editor.
"""
if request.method == 'POST' and request.headers.get('x-requested-with') == 'XMLHttpRequest':
if request.method == 'POST' and request.headers.get('X-Requested-With') == 'XMLHttpRequest':
if 'markdown-image-upload' in request.FILES:
image = request.FILES['markdown-image-upload']
image_types = [
Expand Down

0 comments on commit 8d13742

Please sign in to comment.