Pass view_name to extra_body_script hook (#443)

At the moment it's not easy to tell whether the hook is being called
in (for example) the row or table view, as in both cases the
`database` and `table` parameters are provided.

This passes the `view_name` added in #441 to the `extra_body_script`
hook.
This commit is contained in:
Russ Garrett 2019-05-03 14:12:19 +01:00 committed by Simon Willison
commit bf229c9bd8
3 changed files with 7 additions and 3 deletions

View file

@ -94,6 +94,7 @@ class RenderMixin(HTTPMethodView):
template=template.name,
database=context.get("database"),
table=context.get("table"),
view_name=self.name,
datasette=self.ds
):
body_scripts.append(jinja2.Markup(script))