Skip to content

Commit

Permalink
[36] Fix templating functions
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinHeist committed Nov 12, 2024
1 parent 25ce226 commit 3cbc3ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/internal/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ def get_available_fonts(db: Session) -> list[AvailableFont]:
List of AvailableFont objects for all defined Fonts.
"""

# Cannot be AvailableFont object as these are directly passed to
# Jinja templates
return [
AvailableFont(id=font.id, name=font.name)
{'id': font.id, 'name': font.name} # type: ignore
for font in
db.query(
Font.id,
Expand Down
6 changes: 4 additions & 2 deletions app/internal/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ def get_available_templates(db: Session) -> list[AvailableTemplate]:
db: SQL database to query for the given object.
Returns:
List of AvailableTemplate objects for all defined Templates.
List of dictionaries for all defined Templates.
"""

# Cannot be AvailableTemplate objects as this return is passed
# directly to Jinja templates
return [
AvailableTemplate(id=template.id, name=template.name)
{'id': template.id, 'name': template.name} # type: ignore
for template in
db.query(
Template.id,
Expand Down
2 changes: 1 addition & 1 deletion modules/ref/version_webui
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0-alpha.13.0-webui35
v2.0-alpha.13.0-webui36

0 comments on commit 3cbc3ba

Please sign in to comment.