Skip to content

feat: add locale to invite and invite_batch#1557

Merged
asafshen merged 1 commit into
mainfrom
add-locale-to-invite
Jun 1, 2026
Merged

feat: add locale to invite and invite_batch#1557
asafshen merged 1 commit into
mainfrom
add-locale-to-invite

Conversation

@asafshen

@asafshen asafshen commented Jun 1, 2026

Copy link
Copy Markdown
Member

Description

Adds an optional locale parameter to user.invite and user.invite_batch to control the language of the invite message sent to the user.

Mirrors the equivalent change in the node-sdk: descope/node-sdk#735

The locale value is passed through to the locale field in the user create / batch-create request body.

Changes

  • descope/management/user.py: add locale param to invite, invite_batch, and the _compose_create_body / _compose_create_batch_body helpers
  • tests/management/test_user.py: cover the new param in the invite and invite_batch tests

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 1, 2026 12:27
@shuni-bot-dev

shuni-bot-dev Bot commented Jun 1, 2026

Copy link
Copy Markdown

🐕 Review complete — View session on Shuni Portal 🐾

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 locale parameter to User.invite and User.invite_batch.
  • Plumbed locale into the user create and batch-create request body composition helpers.
  • Extended user management tests to assert locale is 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.

@shuni-bot-dev shuni-bot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 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! 🦴

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Coverage report

The coverage rate went from 98.31% to 98.31% ⬆️

100% of new lines are covered.

Diff Coverage details (click to unfold)

descope/management/user.py

100% of new lines are covered (96.06% of the complete file).

@asafshen asafshen enabled auto-merge (squash) June 1, 2026 12:58
@asafshen asafshen merged commit 536c4e3 into main Jun 1, 2026
35 checks passed
@asafshen asafshen deleted the add-locale-to-invite branch June 1, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants