From 50817efb16e6634504cbabf89348c4f48d557efd Mon Sep 17 00:00:00 2001 From: Stefan Vitanov Date: Tue, 28 Nov 2023 11:41:40 +0200 Subject: [PATCH] fix --- core/auth/auth.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/auth/auth.go b/core/auth/auth.go index 49defb90e..7b587f217 100644 --- a/core/auth/auth.go +++ b/core/auth/auth.go @@ -1934,10 +1934,12 @@ func (a *Auth) deleteAccount(context storage.TransactionContext, account model.A func (a *Auth) deleteAccountFromApps(context storage.TransactionContext, account model.Account, fromAppsIDs []string) error { for _, idToDelete := range fromAppsIDs { - orgApps, _ := a.deleteApps(context, account.OrgAppsMemberships, idToDelete) - account.OrgAppsMemberships = orgApps + orgApps, err := a.deleteApps(context, account.OrgAppsMemberships, idToDelete) + if err != nil { + return errors.WrapErrorAction(logutils.ActionDelete, model.TypeAccount, nil, err) + } - err := a.storage.DeleteAccountOrgAppsMemberships(context, account.ID, orgApps) + err = a.storage.DeleteAccountOrgAppsMemberships(context, account.ID, orgApps) if err != nil { return errors.WrapErrorAction(logutils.ActionDelete, model.TypeAccount, nil, err) }