mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Enhance step data handling in Database class by adding ordering and restructuring data appending
This commit is contained in:
parent
9300d1b4d6
commit
fa48dda8e9
1 changed files with 5 additions and 4 deletions
|
|
@ -3643,13 +3643,14 @@ class Database:
|
|||
session.query(Template_steps)
|
||||
.with_entities(Template_steps.id, Template_steps.title, Template_steps.subtitle)
|
||||
.filter_by(template_id=template.id)
|
||||
.order_by(Template_steps.id)
|
||||
):
|
||||
templates[template.id]["steps"].append({"title": step.title, "subtitle": step.subtitle})
|
||||
|
||||
step_data = {"title": step.title, "subtitle": step.subtitle}
|
||||
if step.id in steps_settings:
|
||||
templates[template.id]["steps"][step.id - 1]["settings"] = steps_settings[step.id]
|
||||
step_data["settings"] = steps_settings[step.id]
|
||||
if step.id in steps_configs:
|
||||
templates[template.id]["steps"][step.id - 1]["configs"] = steps_configs[step.id]
|
||||
step_data["configs"] = steps_configs[step.id]
|
||||
templates[template.id]["steps"].append(step_data)
|
||||
|
||||
return templates
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue