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

don't add defaults to the constraints doc

parent e9985287
No related branches found
No related tags found
1 merge request!1187TMSS-2823
......@@ -95,9 +95,10 @@ def create_scheduling_unit_draft_from_observing_strategy_template(strategy_templ
# use the latest scheduling_constraints_template (can be None, which is acceptable)
scheduling_constraints_template = models.SchedulingConstraintsTemplate.objects.all().order_by('created_at').last()
# extract the scheduling_constraints_doc from the template_doc,
# so we can feed in seperately into the SchedulingUnitDraft.
scheduling_constraints_doc = specifications_doc.pop('scheduling_constraints_doc', {})
# extract the scheduling_constraints_doc from the specifications_doc_overrides, or else from the generated and defaults-including-specifications_doc,
# so we can feed in separately into the SchedulingUnitDraft.
scheduling_constraints_doc = specifications_doc_overrides.get('scheduling_constraints_doc', specifications_doc.get('scheduling_constraints_doc',{}))
specifications_doc.pop('scheduling_constraints_doc', {}) # make sure it's popped/removed from the specifications_doc
with transaction.atomic():
scheduling_unit_draft = models.SchedulingUnitDraft.objects.create(name=name or strategy_template.name,
......
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