diff --git a/ipynbsrv/web/views/collaborationgroups.py b/ipynbsrv/web/views/collaborationgroups.py index cfc75e3..0d3843f 100644 --- a/ipynbsrv/web/views/collaborationgroups.py +++ b/ipynbsrv/web/views/collaborationgroups.py @@ -71,8 +71,6 @@ def create(request): client = get_httpclient_instance(request) try: - # stupid create workaround (see containers) - client.collaborationgroups.get() client.collaborationgroups.post(params) messages.success(request, "Group `{}` created sucessfully.".format(params.get("name"))) except HttpClientError: diff --git a/ipynbsrv/web/views/containers.py b/ipynbsrv/web/views/containers.py index db3e2b5..686033a 100644 --- a/ipynbsrv/web/views/containers.py +++ b/ipynbsrv/web/views/containers.py @@ -28,7 +28,11 @@ def clone(request): new_name = "{}_clone".format(container.name) # create clone - client.containers(ct_id).clone.post({"name": new_name}) + try: + client.containers(ct_id).clone.post({"name": new_name}) + messages.success(request, "Sucessfully created the clone `{}`.".format(new_name)) + except Exception as e: + messages.error(request, api_error_message(e, params)) return redirect('containers') @@ -96,13 +100,11 @@ def create(request): image = client.containers.images(params.get('image_id')).get() except HttpNotFoundError: messages.error(request, "Container bootstrap image does not exist or you don't have enough permissions for the requested operation.") + except Exception as ex: + messages.error(request, api_error_message(ex, params)) if image: try: - # does not make any sense, but seems like it won't work without this line - # Todo: find the actual problem! - client.containers.get() - # server and owner get set by the core automatically client.containers.post(params) messages.success(request, "Image created successfully.") diff --git a/ipynbsrv/web/views/shares.py b/ipynbsrv/web/views/shares.py index 48f1d60..5a32505 100644 --- a/ipynbsrv/web/views/shares.py +++ b/ipynbsrv/web/views/shares.py @@ -61,7 +61,6 @@ def create(request): # create a new tag try: tag_params = {"label": str(tag)} - t = client.tags.get() t = client.tags.post(tag_params) except Exception as e: messages.error(request, api_error_message(e, tag_params)) @@ -105,8 +104,6 @@ def share_add_access_groups(request): params = {} params['access_groups'] = access_groups - # then call API to add the users to the group - client.shares.get() try: client.shares(share_id).add_access_groups.post(params) messages.success(request, "The selected groups are now a member of this share.")