fix: task2 start bug
This commit is contained in:
parent
ea5f4c0a29
commit
55d172588a
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue