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.
This commit is contained in:
william
2026-08-24 09:21:19 +02:00
parent 4b05301e2e
commit 2bb0c253f9
3 changed files with 36 additions and 29 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ from core.flask_app import app
@app.route("/game/<slug>/rename", methods=["POST"])
def game_rename(slug):
new_name = request.form.get("name", "").strip()
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))