Return 200 should be done without Response fix
This commit is contained in:
@@ -60,7 +60,7 @@ def do_izlusci(conllus, prepovedane_besede):
|
|||||||
]}
|
]}
|
||||||
except:
|
except:
|
||||||
return Response(data, 400)
|
return Response(data, 400)
|
||||||
return Response(ret, 200)
|
return ret, 200
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return Response(str(e), 500)
|
return Response(str(e), 500)
|
||||||
|
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ def execute_ateapi_job(job: Job):
|
|||||||
job.save()
|
job.save()
|
||||||
info = json.loads(job.job_input)
|
info = json.loads(job.job_input)
|
||||||
_res = do_izlusci(info['conllus'], info['prepovedane_besede'])
|
_res = do_izlusci(info['conllus'], info['prepovedane_besede'])
|
||||||
|
if type(_res) is tuple:
|
||||||
|
ret_json = _res[0]
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
if type(_res.response) is dict:
|
if type(_res.response) is dict:
|
||||||
ret_json = str(_res.response)
|
ret_json = str(_res.response)
|
||||||
|
|||||||
Reference in New Issue
Block a user