From 34507666d06594d1ecb4ea78f5a0257ae8dab00d Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Mon, 9 Oct 2023 15:16:37 +0200 Subject: [PATCH] Groups: return API result OK when everything succeeded --- groups.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/groups.py b/groups.py index 8e54533fa..bd75f6632 100644 --- a/groups.py +++ b/groups.py @@ -1155,6 +1155,8 @@ def api_group_delete(ctx, group_name): if sram_group: if not sram.sram_delete_collaboration(ctx, co_identifier): return api.Error('sram_error', 'Something went wrong deleting group "{}" in SRAM'.format(group_name)) + + return api.Result.ok() except Exception: return api.Error('error_internal', 'Something went wrong deleting group "{}". Please contact a system administrator'.format(group_name)) @@ -1221,6 +1223,7 @@ def api_group_user_add(ctx, username, group_name): sram.invitation_mail_group_add_user(ctx, group_name, username.split('#')[0], co_identifier) elif config.sram_flow == 'invitation': sram.sram_put_collaboration_invitation(ctx, group_name, username.split('#')[0], co_identifier) + return api.Result.ok() else: return api.Error('policy_error', message) @@ -1302,6 +1305,8 @@ def api_group_remove_user_from_group(ctx, username, group_name): else: if not sram.sram_delete_collaboration_membership(ctx, co_identifier, uid): return api.Error('sram_error', 'Something went wrong removing {} from group "{}" in SRAM'.format(username, group_name)) + + return api.Result.ok() except Exception: return api.Error('error_internal', 'Something went wrong removing {} from group "{}". Please contact a system administrator'.format(username, group_name))