Skip to content
Snippets Groups Projects
Unverified Commit ea332b11 authored by Piero Toffanin's avatar Piero Toffanin Committed by GitHub
Browse files

Merge pull request #216 from fushinari/suggest-errors

suggestions: Abort when missing parameters
parents 124e7366 9edcbe8b
No related branches found
No related tags found
No related merge requests found
......@@ -903,6 +903,15 @@ def create_app(args):
source_lang = request.values.get("source")
target_lang = request.values.get("target")
if not q:
abort(400, description="Invalid request: missing q parameter")
if not s:
abort(400, description="Invalid request: missing s parameter")
if not source_lang:
abort(400, description="Invalid request: missing source parameter")
if not target_lang:
abort(400, description="Invalid request: missing target parameter")
SuggestionsDatabase().add(q, s, source_lang, target_lang)
return jsonify({"success": True})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment