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:
@@ -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")),
|
||||
|
||||
Reference in New Issue
Block a user