feat: add locale to invite and invite_batch#1557
Conversation
Adds an optional `locale` parameter to `user.invite` and `user.invite_batch` to control the language of the invite message, mirroring descope/node-sdk#735. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
There was a problem hiding this comment.
Pull request overview
Adds optional locale support to management user invitation APIs so callers can control the language of invite messages by passing locale through to the create / batch-create request payload.
Changes:
- Added optional
localeparameter toUser.inviteandUser.invite_batch. - Plumbed
localeinto the user create and batch-create request body composition helpers. - Extended user management tests to assert
localeis sent in both single and batch invite request payloads.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
descope/management/user.py |
Adds locale to invite APIs and includes it in composed request bodies when provided. |
tests/management/test_user.py |
Updates invite and invite_batch tests to validate the outgoing JSON includes locale. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🐕 Shuni's Review
Adds an optional locale param to invite / invite_batch that flows through _compose_create_body / _compose_create_batch_body into the request body.
No issues found — good bones! Pattern matches sibling optional fields (templateId, sendMail, sendSMS): conditional if locale is not None inclusion, wire key "locale", tests assert the new field on both code paths. create and create_test_user correctly pass through None since locale is invite-specific.
Woof! 🦴
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)descope/management/user.py
|
Description
Adds an optional
localeparameter touser.inviteanduser.invite_batchto control the language of the invite message sent to the user.Mirrors the equivalent change in the node-sdk: descope/node-sdk#735
The
localevalue is passed through to thelocalefield in the user create / batch-create request body.Changes
descope/management/user.py: addlocaleparam toinvite,invite_batch, and the_compose_create_body/_compose_create_batch_bodyhelperstests/management/test_user.py: cover the new param in the invite and invite_batch tests🤖 Generated with Claude Code