update applications/view/system/dept.py.

修正部门不能更新bug。

id = json.get("deptId"),  会得到tuple
在其后的 Dept.query.filter_by(id=id) , 会生成形如 update 。。。。 from xx where id=( id, ) 的sql,导致执行sql失败
#id = json.get("deptId"), 
改成 
id = str_escape(json.get("deptId")) 即可。

Signed-off-by: 陈心巧 <12432082+chenxinqiao@user.noreply.gitee.com>
This commit is contained in:
陈心巧
2023-11-09 08:11:17 +00:00
committed by Gitee
parent 8a51e19cc0
commit 2e806f1dcf
+2 -1
View File
@@ -108,7 +108,8 @@ def dis_enable():
@authorize("system:dept:edit", log=True)
def update():
json = request.get_json(force=True)
id = json.get("deptId"),
#id = json.get("deptId"),
id = str_escape(json.get("deptId"))
data = {
"dept_name": validate.str_escape(json.get("deptName")),
"sort": validate.str_escape(json.get("sort")),