feat: add final.png export
This commit is contained in:
@@ -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 = ""):
|
||||
|
||||
Reference in New Issue
Block a user