From 0313fba1510ae759dd19024ed0436582ecb8b7d3 Mon Sep 17 00:00:00 2001 From: wuaho Date: Wed, 1 Dec 2021 16:32:37 +0800 Subject: [PATCH] 1 --- api/api_v1/endpoints/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index 6699ef6..dc7e4aa 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -40,7 +40,7 @@ async def edit( """编辑报表""" res = await crud.report.update_one(db, {'_id': data_in.report_id, 'user_id': request.user.id}, {'$set': {'query': data_in.query, 'name': data_in.name, 'desc': data_in.desc}}) - if not res.modified_count: + if not res.matched_count: return schemas.Msg(code=-1, msg='只能报表所有者编辑') return schemas.Msg(code=0, msg='ok', data='编辑成功')