Skip to content

ref(cells): Organization invites go the correct org scoped routes#112137

Merged
lynnagara merged 5 commits intomasterfrom
lynnagara/ref/update-invite-link-to-org-route
Apr 8, 2026
Merged

ref(cells): Organization invites go the correct org scoped routes#112137
lynnagara merged 5 commits intomasterfrom
lynnagara/ref/update-invite-link-to-org-route

Conversation

@lynnagara
Copy link
Copy Markdown
Member

Updates get_invite_link to generate org-scoped invite URLs (/accept/<org_slug>/<member_id>//) instead of the legacy no-org format (/accept/<member_id>//).

This is a prerequisite for removing the legacy no-org invite route and ensuring this works even when multiple cells are configured.

Updates get_invite_link to generate org-scoped invite URLs (/accept/<org_slug>/<member_id>/<token>/)
instead of the legacy no-org format (/accept/<member_id>/<token>/).

This is a prerequisite for removing the legacy no-org invite route
and ensuring this works even when multiple cells are configured.
@lynnagara lynnagara requested a review from a team as a code owner April 2, 2026 19:09
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 2, 2026
@lynnagara lynnagara requested a review from a team April 2, 2026 19:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Backend Test Failures

Failures on bac4c3e in this run:

tests/sentry/core/endpoints/test_organization_details.py::OrganizationSettings2FATest::test_owner_can_set_org_2falog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/core/endpoints/test_organization_details.py:2330: in test_owner_can_set_org_2fa
    self.assert_2fa_email_equal(mail.outbox, user_emails_without_2fa)
tests/sentry/core/endpoints/test_organization_details.py:2227: in assert_2fa_email_equal
    assert invite_url_regex.search(email.body), (
E   AssertionError: No invite URL found in 2FA invite email body to: ['foo_5@example.com']
E   assert None
E    +  where None = <built-in method search of re.Pattern object at 0x7fd9d87bdd40>('Setup Two-Factor Authentication\n\nThe Rapid Narwhal organization now requires all members to enable\ntwo-factor auth...ings:\nhttp://example.com/accept/rapid-narwhal/190/a1c1559ab7b90eeea67dd639e43705dfded50b2fb96163d9cc91382860960169/\n')
E    +    where <built-in method search of re.Pattern object at 0x7fd9d87bdd40> = re.compile('http://.*/accept/[0-9]+/[a-f0-9]+/').search
E    +    and   'Setup Two-Factor Authentication\n\nThe Rapid Narwhal organization now requires all members to enable\ntwo-factor auth...ings:\nhttp://example.com/accept/rapid-narwhal/190/a1c1559ab7b90eeea67dd639e43705dfded50b2fb96163d9cc91382860960169/\n' = <django.core.mail.message.EmailMultiAlternatives object at 0x7fd9ce262c50>.body
tests/sentry/core/endpoints/test_organization_details.py::OrganizationSettings2FATest::test_manager_can_set_2falog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/core/endpoints/test_organization_details.py:2311: in test_manager_can_set_2fa
    self.assert_2fa_email_equal(mail.outbox, [self.owner.email])
tests/sentry/core/endpoints/test_organization_details.py:2227: in assert_2fa_email_equal
    assert invite_url_regex.search(email.body), (
E   AssertionError: No invite URL found in 2FA invite email body to: ['2aa15ad15f3c4ca9b3491cbae3b316b7@example.com']
E   assert None
E    +  where None = <built-in method search of re.Pattern object at 0x7f39807e45b0>('Setup Two-Factor Authentication\n\nThe Healthy Cat organization now requires all members to enable\ntwo-factor authen...ttings:\nhttp://example.com/accept/healthy-cat/114/39a6c4e79fdc86ac63dc4b88bfece458855ed581563a75fd45162cd801a8b994/\n')
E    +    where <built-in method search of re.Pattern object at 0x7f39807e45b0> = re.compile('http://.*/accept/[0-9]+/[a-f0-9]+/').search
E    +    and   'Setup Two-Factor Authentication\n\nThe Healthy Cat organization now requires all members to enable\ntwo-factor authen...ttings:\nhttp://example.com/accept/healthy-cat/114/39a6c4e79fdc86ac63dc4b88bfece458855ed581563a75fd45162cd801a8b994/\n' = <django.core.mail.message.EmailMultiAlternatives object at 0x7f397bac4aa0>.body

Comment thread src/sentry/models/organizationmember.py
Copy link
Copy Markdown
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Looks good, but we'll need to do more changes to completely remove sentry-accept-invite.

Comment thread src/sentry/models/organizationmember.py
@lynnagara lynnagara merged commit 0256081 into master Apr 8, 2026
77 checks passed
@lynnagara lynnagara deleted the lynnagara/ref/update-invite-link-to-org-route branch April 8, 2026 17:59
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
…12137)

Updates get_invite_link to generate org-scoped invite URLs
(/accept/<org_slug>/<member_id>/<token>/) instead of the legacy no-org
format (/accept/<member_id>/<token>/).

This is a prerequisite for removing the legacy no-org invite route and
ensuring this works even when multiple cells are configured.
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.

2 participants