Skip to content

Commit d1ce8de

Browse files
committed
remove_from_organization should succeed, even if account deletion fails.
1 parent 4806174 commit d1ce8de

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/test_functional.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,10 @@ def test_remove_from_organization_delete_federatedid():
237237

238238
def test_remove_from_organization_delete_adobeid():
239239
user = UserAction(id_type=IdentityTypes.adobeID, email="[email protected]")
240-
with pytest.raises(ValueError):
241-
user.remove_from_organization(delete_account=True)
240+
user.remove_from_organization(delete_account=True)
241+
assert user.wire_dict() == {"do": [{"removeFromOrg": {"deleteAccount": True}}],
242+
"user": "[email protected]",
243+
"useAdobeID": True}
242244

243245

244246
def test_delete_account_enterpriseid():

umapi_client/functional.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,7 @@ def remove_from_organization(self, delete_account=False):
288288
:param delete_account: Whether to delete the account after removing from the organization (default false)
289289
:return: None, because you cannot follow this command with another.
290290
"""
291-
if delete_account and self.id_type == IdentityTypes.adobeID:
292-
raise ValueError("You cannot delete an Adobe ID account.")
293-
self.append(removeFromOrg={"deleteAccount": delete_account == True})
291+
self.append(removeFromOrg={"deleteAccount": True if delete_account else False})
294292
return None
295293

296294
def delete_account(self):

0 commit comments

Comments
 (0)