Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/sentry/core/endpoints/organization_member_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,18 @@ def get_allowed_org_roles(
return ()

return member.get_allowed_org_roles_to_invite()


def get_invite_context_from_request(request: Request) -> dict[str, str | None]:
"""
Helper to extract email from an invite token in a session or request parameters.
Used by registration forms to pre-fill the email address.
"""
token = request.GET.get("token") or request.session.get("invite_token")
if not token:
return {"email": None}

from sentry.models.organizationmember import OrganizationMember

member = OrganizationMember.objects.filter(token=token).first()
return {"email": member.email if member else None}

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.

Unused invite context helper

Medium Severity

The new get_invite_context_from_request helper is never imported or called. Registration still uses the existing session invite_email path, so this change does not pre-fill the invited email.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2de6aed. Configure here.

Loading