Esempio n. 1
0
 def read(self, request, from_ws_id, to_ws_id):
     from_ws = get_object_or_404(WorkSpace, id=from_ws_id)
     to_ws = get_object_or_404(WorkSpace, id=to_ws_id)
     
     user = get_user_authentication(request)
     
     packageCloner = PackageCloner()
     
     to_workspace = packageCloner.merge_workspaces(from_ws, to_ws, user)
     
     return HttpResponse("{'result': 'ok', 'merged_workspace_id': %s}" % (to_workspace.id), mimetype='application/json; charset=UTF-8')
Esempio n. 2
0
    def read(self, request, published_ws_id, to_ws_id):
        user = get_user_authentication(request)

        published_workspace = get_object_or_404(PublishedWorkSpace, id=published_ws_id)

        from_ws = published_workspace.workspace
        to_ws = get_object_or_404(WorkSpace, id=to_ws_id)

        packageCloner = PackageCloner()

        to_workspace = packageCloner.merge_workspaces(from_ws, to_ws, user)

        result = {'result': 'ok', 'workspace_id': to_workspace.id}
        return HttpResponse(json_encode(result), mimetype='application/json; charset=UTF-8')