追加任务bug
This commit is contained in:
parent
f16bf41793
commit
bafe8bbaed
|
@ -100,7 +100,6 @@ class TaskViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
|||
depts = request.data['depts']
|
||||
contents = request.data['contents']
|
||||
if obj.state in ['待发布', '执行中']:
|
||||
return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST)
|
||||
if depts and contents:
|
||||
for m in depts:
|
||||
m = Organization.objects.get(pk=m)
|
||||
|
@ -121,6 +120,7 @@ class TaskViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
|||
obj.save()
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
return Response('单位或清单不能为空', status=status.HTTP_400_BAD_REQUEST)
|
||||
return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
|
||||
@action(methods=['get'], detail=True, perms_map = {'get':'*'})
|
||||
|
|
Loading…
Reference in New Issue