Skip to content
Snippets Groups Projects
Commit 2acba874 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Only update specifications_doc in state defined/scheduling/scheduled, and...

Only update specifications_doc in state defined/scheduling/scheduled, and feedback_doc in state-finishing
parent b8be0dba
No related branches found
No related tags found
No related merge requests found
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment