Isolate template options definition
This commit is contained in:
parent
e2e2318c6c
commit
397b54cdbe
2 changed files with 2 additions and 2 deletions
|
@ -9,6 +9,7 @@ TEMPLATES = Environment(
|
||||||
loader=PackageLoader('glicid_spawner'),
|
loader=PackageLoader('glicid_spawner'),
|
||||||
autoescape=select_autoescape(),
|
autoescape=select_autoescape(),
|
||||||
)
|
)
|
||||||
|
TEMPLATE_FORM = TEMPLATES.get_template('spawner_form.html')
|
||||||
|
|
||||||
|
|
||||||
def options_attrs(username: str) -> dict:
|
def options_attrs(username: str) -> dict:
|
||||||
|
@ -24,8 +25,7 @@ def options_attrs(username: str) -> dict:
|
||||||
|
|
||||||
def options_form(username: str) -> str:
|
def options_form(username: str) -> str:
|
||||||
"""Render default spawner form."""
|
"""Render default spawner form."""
|
||||||
template = TEMPLATES.get_template('interactive.html')
|
return TEMPLATE_FORM.render(**options_attrs(username))
|
||||||
return template.render(**options_attrs(username))
|
|
||||||
|
|
||||||
|
|
||||||
def options_from_form(formdata) -> dict:
|
def options_from_form(formdata) -> dict:
|
||||||
|
|
Loading…
Add table
Reference in a new issue