Skip to content

fix(members): Validate teamRoles entries have required keys#115247

Draft
mrduncan wants to merge 1 commit intomasterfrom
mrduncan/fix/member-team-roles-keyerror
Draft

fix(members): Validate teamRoles entries have required keys#115247
mrduncan wants to merge 1 commit intomasterfrom
mrduncan/fix/member-team-roles-keyerror

Conversation

@mrduncan
Copy link
Copy Markdown
Member

@mrduncan mrduncan commented May 8, 2026

The teamRoles field is a ListField of JSONField, so individual items were not validated. Indexing item["role"] / item["teamSlug"] in validate_teamRoles raised KeyError -> 500 when callers sent malformed entries. Reject entries that aren't dicts containing both keys with a ValidationError so the response is a 400 instead.

Fixes SENTRY-52BQ

The teamRoles field is a ListField of JSONField, so individual items
were not validated. Indexing item["role"] / item["teamSlug"] in
validate_teamRoles raised KeyError -> 500 when callers sent malformed
entries. Reject entries that aren't dicts containing both keys with a
ValidationError so the response is a 400 instead.

Fixes SENTRY-52BQ
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant