Skip to content

Commit

Permalink
Allow form.widgets.RenderTemplateWidget to use the theme object
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmayo committed Oct 12, 2024
1 parent 04e8849 commit e441506
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flask_admin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ def __init__(
# Register with application
if app is not None:
self._init_extension()
# Make theme available via current_app
app.config["theme"] = self.theme

def _validate_admin_host_and_subdomain(self):
if self.subdomain is not None and self.host is not None:
Expand Down
1 change: 1 addition & 0 deletions flask_admin/form/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def __call__(self, field, **kwargs):
"_gettext": gettext,
"_ngettext": ngettext,
"h": h,
"theme": current_app.config["theme"],
}
)

Expand Down

0 comments on commit e441506

Please sign in to comment.