Skip to content

Commit

Permalink
Properly use abort_json for JSON error replies
Browse files Browse the repository at this point in the history
  • Loading branch information
horazont committed Oct 5, 2019
1 parent 2dac54d commit 577b3d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions muchopper/web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ def api_search():
)

if not search_address and not search_description and not search_name:
return abort(
return abort_json(
400,
{
"error": "search scope is empty"
Expand All @@ -960,15 +960,15 @@ def api_search():
elif isinstance(keywords, list):
prepped_keywords = queries.filter_keywords(keywords, min_length=3)
else:
return abort(
return abort_json(
400,
{
"error": "keywords must be a string or an array"
}
)

if len(prepped_keywords) > 5:
return abort(
return abort_json(
400,
{
"error": "too many words",
Expand Down

0 comments on commit 577b3d8

Please sign in to comment.