From 04048dde5d8d0f5e2d4f0a50698718f78c042ac4 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Mon, 23 Oct 2023 16:33:37 +0200
Subject: [PATCH] fallback for specifications_doc_overrides or
 specifications_doc

---
 SAS/TMSS/backend/src/tmss/tmssapp/tasks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py
index f3f230b3e96..f7ec27588e2 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py
@@ -97,7 +97,7 @@ def create_scheduling_unit_draft_from_observing_strategy_template(strategy_templ
 
     # 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',{}))
+    scheduling_constraints_doc = (specifications_doc_overrides or specifications_doc).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():
-- 
GitLab