From 81e7de9c5cdf8dcf7d68e0760a19481772e1a812 Mon Sep 17 00:00:00 2001 From: zmister Date: Wed, 21 Jul 2021 19:17:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DMySQL=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=B8=8B=E6=96=87=E6=A1=A3=E5=88=A0=E9=99=A4=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + app_doc/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index baa254d..ba19594 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ - [修复]找回密码邮件发送失败的问题; - [修复]后台管理用户管理用户无法搜索的问题; - [修复]文档访问权限可绕过的问题; +- [优化]MySQL数据库下文档删除失败的问题; - [优化]个人中心我协作的文集页面及功能; - [优化]后台邮件服务器配置逻辑和页面展示; - [优化]文档发布和修改的异常判断和处理; diff --git a/app_doc/views.py b/app_doc/views.py index c48e662..de76bf4 100644 --- a/app_doc/views.py +++ b/app_doc/views.py @@ -1290,7 +1290,7 @@ def del_doc(request): chr_doc = Doc.objects.filter(parent_doc=doc_id) # 获取下级文档 chr_doc_ids = chr_doc.values_list('id',flat=True) # 提取下级文档的ID chr_doc.update(status=3,modify_time=datetime.datetime.now()) # 修改下级文档的状态为删除 - Doc.objects.filter(parent_doc__in=chr_doc_ids).update(status=3,modify_time=datetime.datetime.now()) # 修改下级文档的下级文档状态 + Doc.objects.filter(parent_doc__in=list(chr_doc_ids)).update(status=3,modify_time=datetime.datetime.now()) # 修改下级文档的下级文档状态 return JsonResponse({'status': True, 'data': _('删除完成')}) else: