Return 200 should be done without Response fix

This commit is contained in:
Kikimanox
2022-10-24 18:54:39 +02:00
parent e95d534e78
commit fe6120fb18
2 changed files with 16 additions and 13 deletions
@@ -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)