diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py b/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py index 24d96aed22fadd46fef3fba97ea006c7e6282733..92b4ad5c6a2d3f6eb6c574ee01c49dd5512ceccf 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py @@ -563,8 +563,8 @@ class TaskDraftCopyViewSet(LOFARCopyViewSet): 403: 'forbidden'}, operation_description="Copy a Task Draft to a new Task Draft") def create(self, request, *args, **kwargs): - if 'task_draft_id' in kwargs: - task_draft = get_object_or_404(models.TaskDraft, pk=kwargs["task_draft_id"]) + if 'id' in kwargs: + task_draft = get_object_or_404(models.TaskDraft, pk=kwargs["id"]) body_unicode = request.body.decode('utf-8') body_data = json.loads(body_unicode) @@ -592,7 +592,7 @@ class TaskDraftCopyViewSet(LOFARCopyViewSet): status=status.HTTP_201_CREATED, headers={'Location': task_draft_copy_path}) else: - content = {'Error': 'scheduling_unit_draft_id is missing'} + content = {'Error': 'SchedulingUnitDraft id is missing'} return Response(content, status=status.HTTP_404_NOT_FOUND) diff --git a/SAS/TMSS/backend/src/tmss/urls.py b/SAS/TMSS/backend/src/tmss/urls.py index a17a5982aaa684912ae0cc7ed78b30e427a3beb3..3693478c1a4f6bb7711c5e3f372fd1be20531f2b 100644 --- a/SAS/TMSS/backend/src/tmss/urls.py +++ b/SAS/TMSS/backend/src/tmss/urls.py @@ -183,7 +183,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'task_draft/(?P<task_draft_id>\d+)/copy', viewsets.TaskDraftCopyViewSet) +router.register(r'task_draft/(?P<id>\d+)/copy', viewsets.TaskDraftCopyViewSet) router.register(r'task_blueprint/(?P<id>\d+)/copy_to_draft', viewsets.TaskBlueprintCopyToTaskDraftViewSet) router.register(r'scheduling_set/(?P<id>\d+)/copy_draft\(s\)', viewsets.SchedulingUnitDraftCopyFromSchedulingSetViewSet) router.register(r'scheduling_unit_draft/(?P<id>\d+)/copy', viewsets.SchedulingUnitDraftCopyViewSet)