diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py index 810d42c38dfd98669d4d558b574559c19d232513..84caab6a8c3a5da594d84ba15f368e12f6d1fb07 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/tasks.py @@ -177,7 +177,7 @@ def copy_scheduling_unit_draft(scheduling_unit_draft: models.SchedulingUnitDraft return scheduling_unit_draft_copy -def create_scheduling_unit_draft_from_scheduling_unit_blueprint(scheduling_unit_blueprint: models.SchedulingUnitBlueprint, remove_lofar1_stations=False, remove_lofar2_stations=False) -> models.SchedulingUnitDraft: +def create_scheduling_unit_draft_from_scheduling_unit_blueprint(scheduling_unit_blueprint: models.SchedulingUnitBlueprint, remove_lofar1_stations=False, remove_lofar2_stations=False, add_copy_annotations: bool=True) -> models.SchedulingUnitDraft: """ Create a SchedulingUnitDraft from the SchedulingUnitBlueprint :raises Exception if instantiate fails. @@ -185,8 +185,8 @@ def create_scheduling_unit_draft_from_scheduling_unit_blueprint(scheduling_unit_ logger.debug("create_scheduling_unit_draft_from_scheduling_unit_blueprint(scheduling_unit_blueprint.id=%s)", scheduling_unit_blueprint.pk) with transaction.atomic(): - scheduling_unit_draft_copy = models.SchedulingUnitDraft.objects.create(name="%s (Copy)" % (scheduling_unit_blueprint.name,)[:128], - description="%s (Copy from blueprint id=%s)" % (scheduling_unit_blueprint.description or "<no description>", scheduling_unit_blueprint.id)[:256], + scheduling_unit_draft_copy = models.SchedulingUnitDraft.objects.create(name="%s%s" % (scheduling_unit_blueprint.name, " (Copy)" if add_copy_annotations else "")[:128], + description="%s%s" % (scheduling_unit_blueprint.description or "<no description>", " (Copy from blueprint id=%s)" % (scheduling_unit_blueprint.id,) if add_copy_annotations else "")[:256], scheduling_set=scheduling_unit_blueprint.draft.scheduling_set, observation_strategy_template=scheduling_unit_blueprint.draft.observation_strategy_template, specifications_template=scheduling_unit_blueprint.specifications_template,