Skip to content

Commit 2ca007b

Browse files
authored
Invite with specific user status (#556)
related to descope/etc#10001 + test
1 parent 3c75966 commit 2ca007b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

descope/management/user.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(
3434
sso_app_ids: Optional[List[str]] = None,
3535
password: Optional[UserPassword] = None,
3636
seed: Optional[str] = None,
37+
status: Optional[str] = None,
3738
):
3839
self.login_id = login_id
3940
self.email = email
@@ -52,6 +53,7 @@ def __init__(
5253
self.sso_app_ids = sso_app_ids
5354
self.password = password
5455
self.seed = seed
56+
self.status = status
5557

5658

5759
class User(AuthBase):
@@ -1797,6 +1799,8 @@ def _compose_create_batch_body(
17971799
hashed_password=hashed_password,
17981800
seed=user.seed,
17991801
)
1802+
if user.status is not None:
1803+
uBody["status"] = user.status
18001804
usersBody.append(uBody)
18011805

18021806
body = {"users": usersBody, "invite": True}

tests/management/test_user.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ def test_invite_batch(self):
309309
),
310310
),
311311
seed="aaa",
312+
status="invited",
312313
)
313314
resp = self.client.mgmt.user.invite_batch(
314315
users=[user],
@@ -349,7 +350,8 @@ def test_invite_batch(self):
349350
}
350351
},
351352
"seed": "aaa",
352-
}
353+
"status": "invited",
354+
},
353355
],
354356
"invite": True,
355357
"inviteUrl": "invite.me",

0 commit comments

Comments
 (0)