Files
Forge-Engine/routes/games/game_rename.py
T
william 2bb0c253f9 Fix object-form breaking on repeat pjax visits, and stray autofill in game rename field
object_form.js declared top-level const bindings, which pjax replays verbatim on every visit — the second visit threw "already declared" and silently broke "Ajouter un champ"/"Créer l'objet". Wrapped it in an IIFE. Also renamed the generic name="name" rename-game field to name="game_name" with autocomplete off, since browsers were autofilling it with unrelated previously-typed values.
2026-08-24 09:21:19 +02:00

14 lines
341 B
Python

from flask import request, redirect, url_for
import db
from core.flask_app import app
@app.route("/game/<slug>/rename", methods=["POST"])
def game_rename(slug):
new_name = request.form.get("game_name", "").strip()
if new_name:
db.update_game_name(slug, new_name)
return redirect(url_for("game_dashboard", slug=slug))