Skip to content
Snippets Groups Projects
Commit e9ca968d authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

TMSS-308: add subtask id to validation error

parent 2edc1a51
No related branches found
No related tags found
2 merge requests!260syncing cob-master with master again,!251Resolve TMSS-308
...@@ -204,7 +204,7 @@ class Subtask(BasicCommon): ...@@ -204,7 +204,7 @@ class Subtask(BasicCommon):
sap_names = [pointing['name'] for pointing in self.specifications_doc['stations']['digital_pointings']] sap_names = [pointing['name'] for pointing in self.specifications_doc['stations']['digital_pointings']]
duplicate_names = [name for name in set(sap_names) if sap_names.count(name) > 1] duplicate_names = [name for name in set(sap_names) if sap_names.count(name) > 1]
if duplicate_names: if duplicate_names:
raise ValidationError("Pointings defined in the same Subtask must have unique names. Duplicate names are %s" % duplicate_names) raise ValidationError("Pointings defined in the same Subtask must have unique names. Duplicate names %s in subtask id=%s." % (duplicate_names, self.pk))
# check if we have a start time or there were predecessors # check if we have a start time or there were predecessors
if self.state.value == SubtaskState.Choices.SCHEDULED.value and self.__original_state_id == SubtaskState.Choices.SCHEDULING.value: if self.state.value == SubtaskState.Choices.SCHEDULED.value and self.__original_state_id == SubtaskState.Choices.SCHEDULING.value:
......
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