summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorhandingkang <[email protected]>2024-05-23 22:50:43 +0800
committerhandingkang <[email protected]>2024-05-23 22:50:43 +0800
commit790e0618e68883d341d6206f486a28165ede4fdf (patch)
tree42a5d3475b9c8804e7c8a2350113133f5547f350 /server
parent37e920d5edc7e782a10d397b9e5dd15429278317 (diff)
/task/del接口新增对非法任务id的处理
Diffstat (limited to 'server')
-rw-r--r--server/apps/task.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/apps/task.py b/server/apps/task.py
index 74be644..972c6d7 100644
--- a/server/apps/task.py
+++ b/server/apps/task.py
@@ -399,6 +399,8 @@ def del_task(json_data):
try:
da.cursor.execute(sql)
da.conn.commit()
+ if da.cursor.rowcount == 0:
+ return {"code": "404", "msg": "该任务id未找到!"}
except Exception as e:
error(str(e))
return {"code": 500, "msg": str(e)}