From 1b0957a51236dc3d6aad250c36dc72ddbc94c8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= <250213850@qq.com> Date: Fri, 27 May 2022 16:36:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E5=B7=B2?= =?UTF-8?q?=E5=BB=BA=E6=8A=A5=E8=A1=A8=E6=97=B6=E5=8F=AA=E6=9C=89=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E5=88=9B=E5=BB=BA=E8=80=85=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=88=90=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BA=86=E7=9B=B8=E5=85=B3=E6=9D=83=E9=99=90=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=AF=E4=BB=A5=E7=9C=8B=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/report.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index 486b2ad..0103a19 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -43,7 +43,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.matched_count: # #if res.matched_count: # return schemas.Msg(code=-1, msg='只能报表所有者编辑') @@ -90,8 +90,12 @@ async def read_report( dashboard = await crud.dashboard.get(db, id=data_in.dashboard_id) # projection = {'query': False} projection = None + #获取已建报表 属于自己的 + # reports = await crud.report.read_report(db, project_id=data_in.project_id, + # projection=projection, **ext_where) + #有权限的都能获取到 reports = await crud.report.read_report(db, project_id=data_in.project_id, - projection=projection, **ext_where) + projection=projection) for item in reports: item['added'] = False