feat: add final.png export

This commit is contained in:
2026-10-25 14:07:57 +01:00
parent 73b279d7fe
commit 5fc79197f6
7 changed files with 147 additions and 7 deletions
+9
View File
@@ -10,6 +10,7 @@ from ninja.security import django_auth_is_staff
from games.decorators import require_game_enabled
from .canvas import read_canvas
from .export import build_final_png
from .gif import build_evolution_gif
from .heatmap import (
DecayMode,
@@ -59,6 +60,14 @@ def evolution_gif(request: HttpRequest, event_path: str, players: str = ""):
)
@router.get(f"{PREFIX}/final.png", auth=django_auth_is_staff)
@decorate_view(require_game_enabled(path="place"))
def final_png(request: HttpRequest, event_path: str):
"""Admin-only: the real final board as a PNG, even once placement is
over and everyone else sees it wiped."""
return HttpResponse(build_final_png(request.event), content_type="image/png")
@router.get(f"{PREFIX}/heatmap.png", auth=django_auth_is_staff)
@decorate_view(require_game_enabled(path="place"))
def heatmap_png(request: HttpRequest, event_path: str, players: str = ""):