From 00b253668b4ed25d1ab31988f33c47bcc41f855e Mon Sep 17 00:00:00 2001 From: yangjian Date: Sun, 2 Aug 2020 06:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_doc/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app_doc/views.py b/app_doc/views.py index dda562c..9748f82 100644 --- a/app_doc/views.py +++ b/app_doc/views.py @@ -1917,7 +1917,10 @@ def search(request): if search_type == 'doc': if is_auth: colla_list = [i.project.id for i in ProjectCollaborator.objects.filter(user=request.user)] # 用户的协作文集 - open_list = [i.id for i in Project.objects.filter(role=0)] # 公开文集 + open_list = [i.id for i in Project.objects.filter( + Q(role=0) | Q(create_user=request.user) + )] # 公开文集 + view_list = list(set(open_list).union(set(colla_list))) # 合并上述两个文集ID列表 data_list = Doc.objects.filter(