From 397b54cdbeef6c38b56bee8b87ed6c69589cebb8 Mon Sep 17 00:00:00 2001 From: Benoit Seignovert Date: Wed, 14 Feb 2024 15:19:28 +0100 Subject: [PATCH] Isolate template options definition --- src/glicid_spawner/form.py | 4 ++-- .../templates/{interactive.html => spawner_form.html} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename src/glicid_spawner/templates/{interactive.html => spawner_form.html} (100%) diff --git a/src/glicid_spawner/form.py b/src/glicid_spawner/form.py index 73c3ff7..15665b7 100644 --- a/src/glicid_spawner/form.py +++ b/src/glicid_spawner/form.py @@ -9,6 +9,7 @@ TEMPLATES = Environment( loader=PackageLoader('glicid_spawner'), autoescape=select_autoescape(), ) +TEMPLATE_FORM = TEMPLATES.get_template('spawner_form.html') def options_attrs(username: str) -> dict: @@ -24,8 +25,7 @@ def options_attrs(username: str) -> dict: def options_form(username: str) -> str: """Render default spawner form.""" - template = TEMPLATES.get_template('interactive.html') - return template.render(**options_attrs(username)) + return TEMPLATE_FORM.render(**options_attrs(username)) def options_from_form(formdata) -> dict: diff --git a/src/glicid_spawner/templates/interactive.html b/src/glicid_spawner/templates/spawner_form.html similarity index 100% rename from src/glicid_spawner/templates/interactive.html rename to src/glicid_spawner/templates/spawner_form.html