From 395f6e8deaf6e5095ac5b74f4f90ca5fea01378b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sun, 14 Jun 2026 11:48:43 +0200 Subject: [PATCH] Fix logging out --- common/layout.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/layout.py b/common/layout.py index acc96ec..8328710 100644 --- a/common/layout.py +++ b/common/layout.py @@ -12,6 +12,7 @@ from typing import TYPE_CHECKING from django.contrib.messages import get_messages from django.http import HttpRequest, HttpResponse +from django.middleware.csrf import get_token from django.templatetags.static import static from django.urls import reverse from django.utils.html import conditional_escape @@ -186,7 +187,7 @@ def _main_script(mastered: bool) -> str: return _MAIN_SCRIPT_A + ("true" if mastered else "false") + _MAIN_SCRIPT_B -def Navbar(*, today_played: str, last_7_played: str, current_year: int) -> "Node": +def Navbar(*, today_played: str, last_7_played: str, current_year: int, csrf_token: str) -> "Node": """Top navigation bar. Static chrome, so it's a single ``Safe`` node wrapping its markup rather @@ -270,7 +271,10 @@ def Navbar(*, today_played: str, last_7_played: str, current_year: int) -> "Node Stats
  • - Log out +
    + + +
  • @@ -309,6 +313,7 @@ def Page( today_played=counts["today_played"], last_7_played=counts["last_7_played"], current_year=year, + csrf_token=get_token(request), ) messages = [