forked from mirror/MrDoc
优化删除用户时对用户所属文档的处理
This commit is contained in:
parent
9bd6e091c1
commit
141a01578b
@ -520,6 +520,9 @@ class AdminUserDetail(APIView):
|
||||
def delete(self, request, id):
|
||||
try:
|
||||
user = self.get_object(id) # 获取用户
|
||||
projects = Project.objeects.filter(create_user=user) # 获取用户自己的文集
|
||||
for p in projects:
|
||||
Doc.objects.filter(top_doc=p.id).delete()
|
||||
colloas = ProjectCollaborator.objects.filter(user=user) # 获取参与协作的文集
|
||||
# 遍历用户参与协作的文集
|
||||
for colloa in colloas:
|
||||
|
Loading…
Reference in New Issue
Block a user