Remove load_plugin hook - closes #1073

Refs #1042

This reverts commit 81dea4b07a.
This commit is contained in:
Simon Willison 2020-10-31 09:21:22 -07:00
commit f0a740ac21
8 changed files with 11 additions and 73 deletions

View file

@ -43,7 +43,6 @@ EXPECTED_PLUGINS = [
"extra_js_urls",
"extra_template_vars",
"forbidden",
"load_template",
"menu_links",
"permission_allowed",
"prepare_connection",

View file

@ -308,9 +308,3 @@ def table_actions(datasette, database, table, actor):
},
{"href": datasette.urls.instance(), "label": "Table: {}".format(table)},
]
@hookimpl
def load_template(template, request):
if template == "show_json.html" and request.args.get("_special"):
return "<h1>Special show_json: {{ filename }}</h1>"

View file

@ -801,8 +801,3 @@ def test_hook_table_actions(app_client):
{"label": "Database: fixtures", "href": "/"},
{"label": "Table: facetable", "href": "/"},
]
def test_hook_load_template(app_client):
response = app_client.get("/-/databases?_special=1")
assert response.text == "<h1>Special show_json: databases.json</h1>"