Merge branch 'main' into add_update_option

This commit is contained in:
Piero Toffanin 2023-09-29 21:30:45 -04:00 committed by GitHub
commit bc4bf7cadb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1038,10 +1038,18 @@ def create_app(args):
if not args.suggestions:
abort(403, description=_("Suggestions are disabled on this server."))
if request.is_json:
json = get_json_dict(request)
q = json.get("q")
s = json.get("s")
source_lang = json.get("source")
target_lang = json.get("target")
else:
q = request.values.get("q")
s = request.values.get("s")
source_lang = request.values.get("source")
target_lang = request.values.get("target")
if not q:
abort(400, description=_("Invalid request: missing %(name)s parameter", name='q'))
if not s: