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

TMSS-2890: do/don't add copy annotations to name/description

parent e8a86f80
No related branches found
No related tags found
1 merge request!1287TMSS-2890
...@@ -177,7 +177,7 @@ def copy_scheduling_unit_draft(scheduling_unit_draft: models.SchedulingUnitDraft ...@@ -177,7 +177,7 @@ def copy_scheduling_unit_draft(scheduling_unit_draft: models.SchedulingUnitDraft
return scheduling_unit_draft_copy 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 Create a SchedulingUnitDraft from the SchedulingUnitBlueprint
:raises Exception if instantiate fails. :raises Exception if instantiate fails.
...@@ -185,8 +185,8 @@ def create_scheduling_unit_draft_from_scheduling_unit_blueprint(scheduling_unit_ ...@@ -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) logger.debug("create_scheduling_unit_draft_from_scheduling_unit_blueprint(scheduling_unit_blueprint.id=%s)", scheduling_unit_blueprint.pk)
with transaction.atomic(): with transaction.atomic():
scheduling_unit_draft_copy = models.SchedulingUnitDraft.objects.create(name="%s (Copy)" % (scheduling_unit_blueprint.name,)[:128], scheduling_unit_draft_copy = models.SchedulingUnitDraft.objects.create(name="%s%s" % (scheduling_unit_blueprint.name, " (Copy)" if add_copy_annotations else "")[:128],
description="%s (Copy from blueprint id=%s)" % (scheduling_unit_blueprint.description or "<no description>", scheduling_unit_blueprint.id)[:256], 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, scheduling_set=scheduling_unit_blueprint.draft.scheduling_set,
observation_strategy_template=scheduling_unit_blueprint.draft.observation_strategy_template, observation_strategy_template=scheduling_unit_blueprint.draft.observation_strategy_template,
specifications_template=scheduling_unit_blueprint.specifications_template, specifications_template=scheduling_unit_blueprint.specifications_template,
......
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