fix: task2 start bug

This commit is contained in:
caoqianming 2023-06-06 14:27:40 +08:00
parent ea5f4c0a29
commit 55d172588a
1 changed files with 2 additions and 2 deletions

View File

@ -455,10 +455,10 @@ class Task2ViewSet(CreateUpdateCustomMixin, ModelViewSet):
for key in Pgoal.basedict:
pds = PgoalDept.objects.filter(task2do=i, goal_key=key)
if pds.exists():
pds.update(**{'goal_name': Pgoal.basedict[key], 'goal_value_a': getattr(pg, key), 'goal_o_file': getattr(pg, key+'_file')})
pds.update(**{'goal_name': Pgoal.basedict[key], 'goal_value_a': getattr(pg, key)})
else:
PgoalDept.objects.create(**{'year': i.task2.year, 'task2do': i, 'belong_dept': i.belong_dept,
'goal_name': Pgoal.basedict[key], 'goal_key': key, 'goal_value_a': getattr(pg, key), 'goal_o_file': getattr(pg, key+'_file')})
'goal_name': Pgoal.basedict[key], 'goal_key': key, 'goal_value_a': getattr(pg, key)})
obj.state = Task2.TASK2_DOING
obj.save()
return Response()