From d392dc1cfaeb8d2d7138d3d1d6aa0881f2f30589 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 8 Jun 2020 19:22:40 -0700 Subject: [PATCH] Fixed test_table_not_exists_json test --- datasette/app.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/datasette/app.py b/datasette/app.py index d562e611..79f52a54 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -1016,14 +1016,7 @@ class DatasetteRouter(AsgiRouter): if status != 500: templates = ["{}.html".format(status)] + templates info.update( - { - "ok": False, - "error": message, - "status": status, - "title": title, - "base_url": self.ds.config("base_url"), - "app_css_hash": self.ds.app_css_hash(), - } + {"ok": False, "error": message, "status": status, "title": title,} ) headers = {} if self.ds.cors: @@ -1033,7 +1026,16 @@ class DatasetteRouter(AsgiRouter): else: template = self.ds.jinja_env.select_template(templates) await asgi_send_html( - send, await template.render_async(info), status=status, headers=headers + send, + await template.render_async( + dict( + info, + base_url=self.ds.config("base_url"), + app_css_hash=self.ds.app_css_hash(), + ) + ), + status=status, + headers=headers, )