Skip to content
Snippets Groups Projects
Commit 595a9a94 authored by Fabio Vitello's avatar Fabio Vitello
Browse files

TMSS-234: Renamed copy_scheduling_unit_draft to copy_scheduling_unit_drafts

parent 4b0bf2ca
No related branches found
No related tags found
1 merge request!181Resolve TMSS-234
......@@ -470,8 +470,8 @@ class SchedulingUnitDraftCopyFromSchedulingSetViewSet(LOFARCopyViewSet):
scheduling_unit_draft_copy = copy_scheduling_unit_draft(scheduling_unit_draft,scheduling_set,copy_reason)
# url path magic to construct the new scheduling_unit_draft url
copy_scheduling_unit_draft_path = request._request.path
base_path = copy_scheduling_unit_draft_path[:copy_scheduling_unit_draft_path.find('/copy_scheduling_unit_draft')]
scheduling_unit_draft_copy_path += ['%s/copy_scheduling_unit_draft/%s/' % (base_path, scheduling_unit_draft_copy.id,)]
base_path = copy_scheduling_unit_draft_path[:copy_scheduling_unit_draft_path.find('/copy_scheduling_unit_drafts')]
scheduling_unit_draft_copy_path += ['%s/copy_scheduling_unit_drafts/%s/' % (base_path, scheduling_unit_draft_copy.id,)]
# just return as a response the serialized scheduling_set (with references to the created copy_scheduling_unit_draft(s)
return Response(serializers.SchedulingSetSerializer(scheduling_set, context={'request':request}).data,status=status.HTTP_201_CREATED)
......
......@@ -141,7 +141,7 @@ router.register(r'task_blueprint/(?P<task_blueprint_id>\d+)/task_relation_bluepr
router.register(r'task_blueprint/(?P<task_blueprint_id>\d+)/subtask', viewsets.SubtaskNestedViewSet)
# copy
router.register(r'scheduling_set/(?P<scheduling_set_id>\d+)/copy_scheduling_unit_draft', viewsets.SchedulingUnitDraftCopyFromSchedulingSetViewSet)
router.register(r'scheduling_set/(?P<scheduling_set_id>\d+)/copy_scheduling_unit_drafts', viewsets.SchedulingUnitDraftCopyFromSchedulingSetViewSet)
router.register(r'scheduling_unit_draft/(?P<scheduling_unit_draft_id>\d+)/copy', viewsets.SchedulingUnitDraftCopyViewSet)
router.register(r'scheduling_unit_blueprint/(?P<scheduling_unit_blueprint_id>\d+)/copy_to_scheduling_unit_draft', viewsets.SchedulingUnitBlueprintCopyToSchedulingUnitDraftViewSet)
router.register(r'task_blueprint/(?P<task_blueprint_id>\d+)/copy_to_task_draft', viewsets.TaskBlueprintCopyToTaskDraftViewSet)
......
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