mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-22 07:51:00 +00:00
Merge branch 'main' into add_update_option
This commit is contained in:
commit
bc4bf7cadb
1 changed files with 12 additions and 4 deletions
|
@ -1038,10 +1038,18 @@ def create_app(args):
|
||||||
if not args.suggestions:
|
if not args.suggestions:
|
||||||
abort(403, description=_("Suggestions are disabled on this server."))
|
abort(403, description=_("Suggestions are disabled on this server."))
|
||||||
|
|
||||||
q = request.values.get("q")
|
if request.is_json:
|
||||||
s = request.values.get("s")
|
json = get_json_dict(request)
|
||||||
source_lang = request.values.get("source")
|
q = json.get("q")
|
||||||
target_lang = request.values.get("target")
|
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:
|
if not q:
|
||||||
abort(400, description=_("Invalid request: missing %(name)s parameter", name='q'))
|
abort(400, description=_("Invalid request: missing %(name)s parameter", name='q'))
|
||||||
if not s:
|
if not s:
|
||||||
|
|
Loading…
Reference in a new issue