Skip to content

Commit

Permalink
Merge pull request #163 from Will-Cooper/falsesolo
Browse files Browse the repository at this point in the history
Returning 404 on bad solo object search
  • Loading branch information
kelle authored Jan 9, 2024
2 parents eb22eb9 + 45bce6d commit 078af52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions simple_app/app_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion simple_app/templates/bad_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="container">
<h1 class="display-2" style="text-align: center">{{ e.code|safe }}</h1>
<h2 class="display-3" style="text-align: center">Something went wrong!</h2>
<h2 class="display-3" style="text-align: center">Something went wrong:<br>{{ e.description|safe }}</h2>
<h3 class="display-6">Please send the above error code and what you were trying to do, to the
<a href="https://github.com/SIMPLE-AstroDB/SIMPLE-web/issues/new/choose" target="_blank">developers</a>.
</h3>
Expand Down

0 comments on commit 078af52

Please sign in to comment.