Skip to content
Snippets Groups Projects
Commit dbe99a98 authored by Mario Raciti's avatar Mario Raciti
Browse files

TMSS-1131: Fix relative_stop_time for TaskDrafts

parent 9d8a663f
No related branches found
No related tags found
1 merge request!643Resolve TMSS-1131
...@@ -1268,8 +1268,8 @@ class TaskDraft(NamedCommon, TemplateSchemaMixin, ProjectPropertyMixin): ...@@ -1268,8 +1268,8 @@ class TaskDraft(NamedCommon, TemplateSchemaMixin, ProjectPropertyMixin):
''' '''
# todo: when it was added, check if self.specifications_template.type.value == TaskType.Choices.OBSERVATION.value: # todo: when it was added, check if self.specifications_template.type.value == TaskType.Choices.OBSERVATION.value:
try: try:
duration = self.specifications_doc["duration"] duration = datetime.timedelta(seconds=self.specifications_doc.get('duration', self.specifications_doc.get('target', {}).get('duration', 0)))
return self.relative_start_time + datetime.timedelta(seconds=duration) return self.relative_start_time + duration
except: except:
pass pass
return self.relative_start_time return self.relative_start_time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment