From c333d4970aebbcaee0143a28ada1e60be3ea30d8 Mon Sep 17 00:00:00 2001 From: Will-Cooper Date: Tue, 9 Jan 2024 19:42:11 +0000 Subject: [PATCH 1/2] fail on no result in solo_result --- simple_app/app_simple.py | 2 ++ simple_app/templates/bad_request.html | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/simple_app/app_simple.py b/simple_app/app_simple.py index 6447cb0..c8210c2 100644 --- a/simple_app/app_simple.py +++ b/simple_app/app_simple.py @@ -191,6 +191,8 @@ def solo_result(query: str): # search database for given object resultdict: dict = db.inventory(query) + if not len(resultdict): + abort(404, f'"{query}" does match any result in SIMPLE!') everything = Inventory(resultdict) # create camd and spectra plots diff --git a/simple_app/templates/bad_request.html b/simple_app/templates/bad_request.html index 8d9bb31..8b9ef41 100644 --- a/simple_app/templates/bad_request.html +++ b/simple_app/templates/bad_request.html @@ -3,9 +3,9 @@ {% block content %} -
+

{{ e.code|safe }}

-

Something went wrong!

+

Something went wrong:
{{ e.description|safe }}

Please send the above error code and what you were trying to do, to the developers.

From 45bce6de1b8d8c4f98e1bb2b10598628216537d7 Mon Sep 17 00:00:00 2001 From: Will-Cooper Date: Tue, 9 Jan 2024 19:44:26 +0000 Subject: [PATCH 2/2] weird typo --- simple_app/templates/bad_request.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple_app/templates/bad_request.html b/simple_app/templates/bad_request.html index 8b9ef41..917a137 100644 --- a/simple_app/templates/bad_request.html +++ b/simple_app/templates/bad_request.html @@ -3,7 +3,7 @@ {% block content %} -
+

{{ e.code|safe }}

Something went wrong:
{{ e.description|safe }}

Please send the above error code and what you were trying to do, to the