Skip to content

Commit a0cdd08

Browse files
authored
fix(integrations)-org-in-url-notify-disable (#54234)
Fix for #53533 Replace URL for notify when integrations are disabled with: `/settings/sentry/developer-settings/just-a-test-eb81a3/` Currently: `/settings/developer-settings/projects/just%20a%20test/` Part of [Notify on Disabled Integration project](https://www.notion.so/sentry/Tech-Spec-Notify-on-Disabled-Integration-Spec-e7ea0f86ccd6419cb3e564067cf4a2ef?pvs=4)
1 parent afe4564 commit a0cdd08

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/sentry/integrations/notify_disable.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
}
1111

1212

13-
def get_url(organization: Organization, provider_type: str, provider: str) -> str:
13+
def get_url(organization: Organization, provider_type: str, name: str) -> str:
1414
if provider_type:
1515
type_name = provider_types.get(provider_type, "")
1616
if type_name:
1717
return str(
1818
organization.absolute_url(
19-
f"/settings/{type_name}/{provider}/",
19+
f"/settings/{organization.slug}/{type_name}/{name}/",
2020
)
2121
)
2222

@@ -39,13 +39,14 @@ def notify_disable(
3939
organization: Organization,
4040
integration_name: str,
4141
redis_key: str,
42+
integration_slug: Union[str, None] = None,
4243
project: Union[str, None] = None,
4344
):
4445

4546
integration_link = get_url(
4647
organization,
4748
get_provider_type(redis_key),
48-
integration_name,
49+
integration_slug if "sentry-app" in redis_key and integration_slug else integration_name,
4950
)
5051

5152
for user in organization.get_owners():

tests/sentry/integrations/slack/test_disable.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ def test_email(self):
8080
assert len(mail.outbox) == 1
8181
msg = mail.outbox[0]
8282
assert msg.subject == "Action required: re-authenticate or fix your Slack integration"
83-
assert (f"/settings/integrations/{self.integration.provider}") in msg.body
83+
assert (
84+
self.organization.absolute_url(
85+
f"/settings/{self.organization.slug}/integrations/{self.integration.provider}"
86+
)
87+
in msg.body
88+
)
8489

8590
@responses.activate
8691
def test_fatal_integration(self):

0 commit comments

Comments
 (0)