Skip to content
Snippets Groups Projects

TMSS-2328: do not perform out-of-schema validation on read access of SU unit...

Merged TMSS-2328: do not perform out-of-schema validation on read access of SU unit...
All threads resolved!
Merged Jörn Künsemöller requested to merge TMSS-2328 into master
All threads resolved!
1 file
+ 10
1
Compare changes
  • Side-by-side
  • Inline
@@ -1481,7 +1481,16 @@ class SchedulingUnitBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, Schedul
specifications_doc['parameters'] = self.draft.observation_strategy_template.template.get('parameters', [])
# ensure that the generated specifications_doc is valid according to the schema (raises if not valid)
self.specifications_template.validate_document(specifications_doc)
try:
if self.status.value in SchedulingUnitStatus.PRE_ACTIVE_STATUS_VALUES:
self.specifications_template.validate_document(specifications_doc, raise_on_obsolete=False)
else:
# we only validate against the schema for active units (skip rule-based validation) because rules can
# change and old specs should still be readable.
self.specifications_template.validate_document_against_schema(specifications_doc)
except ValidationException as ve:
# wrap validation exception, and add object info
raise ValidationException("%s\nfor SchedulingUnitBlueprint id=%s name=%s" % (str(ve), self.id, self.name))
return specifications_doc
Loading