更新了软删除
This commit is contained in:
@@ -1280,7 +1280,7 @@ class UserDepartureDetail(APIView):
|
||||
return Response({'status': 'error', 'message': '缺少参数:页码和每页数量不能为空', 'code': 1}, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
# 查询离职财务登记的审批记录
|
||||
Q_obj = Q(type="离职财务登记")
|
||||
Q_obj = Q(type="离职财务登记", is_deleted=False)
|
||||
|
||||
if username:
|
||||
Q_obj &= Q(title__icontains=username) | Q(content__icontains=username)
|
||||
@@ -1304,7 +1304,7 @@ class UserDepartureDetail(APIView):
|
||||
for approval in user_agents_page.object_list:
|
||||
# 获取用户信息
|
||||
try:
|
||||
user = User.objects.get(id=int(approval.user_id))
|
||||
user = User.objects.get(id=int(approval.user_id), is_deleted=False)
|
||||
user_info = {
|
||||
'id': user.id,
|
||||
'username': user.username,
|
||||
@@ -1362,13 +1362,13 @@ class EditUserDeparture(APIView):
|
||||
return Response({'status': 'error', 'message': '缺少参数id', 'code': 1}, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
try:
|
||||
approval = Approval.objects.get(id=id, type="离职财务登记")
|
||||
approval = Approval.objects.get(id=id, type="离职财务登记", is_deleted=False)
|
||||
except Approval.DoesNotExist:
|
||||
return Response({'status': 'error', 'message': '离职登记记录不存在', 'code': 1}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
# 获取用户信息
|
||||
try:
|
||||
user = User.objects.get(id=int(approval.user_id))
|
||||
user = User.objects.get(id=int(approval.user_id), is_deleted=False)
|
||||
except (User.DoesNotExist, ValueError):
|
||||
return Response({'status': 'error', 'message': '用户不存在', 'code': 1}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user