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

only annotate/validate docs in relevant states

parent e82c6ede
No related branches found
No related tags found
1 merge request!1148TMSS_992
......@@ -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.
Finish editing this message first!
Please register or to comment