diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py b/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py index 4e443520d9bb3accc181a7ad4a433f9d21591268..e5fcd0b6072b62c7e43d2e39022301c1bc472f00 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py @@ -631,11 +631,12 @@ class Dataproduct(RefreshFromDbInvalidatesCachedPropertiesMixin, TemplateSchemaM self.validate_doc_using_template('specifications_doc', 'specifications_template') def save(self, force_insert=False, force_update=False, using=None, update_fields=None): - if self.producer.subtask.state.value != SubtaskState.Choices.FINISHED.value: + if self.producer.subtask.state.value in (SubtaskState.Choices.DEFINED.value, SubtaskState.Choices.SCHEDULING.value, SubtaskState.Choices.SCHEDULED.value): self.annotate_doc_using_template('specifications_doc', 'specifications_template') self.add_defaults_to_doc_using_template('specifications_doc', 'specifications_template') self.validate_doc_using_template('specifications_doc', 'specifications_template') + if self.producer.subtask.state.value == SubtaskState.Choices.FINISHING.value: self.annotate_doc_using_template('feedback_doc', 'feedback_template') self.validate_doc_using_template('feedback_doc', 'feedback_template')