Skip to content

Commit 5aaacbd

Browse files
committed
make debug consistent to calls
1 parent 94ecd6d commit 5aaacbd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from django.http import HttpRequest, HttpResponse
22
from django.views.generic import View
33

4-
from sentry import integrations
54
from sentry.integrations.notify_disable import get_provider_type, get_url
65
from sentry.models import Integration, Organization
76

@@ -10,8 +9,9 @@
109

1110
class DebugNotifyDisableView(View):
1211
def get(self, request: HttpRequest) -> HttpResponse:
13-
self.integration = Integration.objects.create(
12+
self.integration, _ = Integration.objects.get_or_create(
1413
provider="slack",
14+
external_id="TXXXXXXX",
1515
name="Awesome Team",
1616
metadata={
1717
"access_token": "xoxb-xxxxxxxxx-xxxxxxxxxx-xxxxxxxxxxxx",
@@ -21,19 +21,18 @@ def get(self, request: HttpRequest) -> HttpResponse:
2121

2222
self.organization = Organization(id=1, slug="organization", name="My Company")
2323

24-
provider = integrations.get(self.integration.provider)
25-
integration_name = provider.name
24+
integration_name = self.integration.provider
2625
integration_link = get_url(
2726
self.organization,
2827
get_provider_type(f"sentry-integration-error:{self.integration.external_id}"),
29-
provider.name,
28+
self.integration.provider,
3029
)
3130

3231
return MailPreview(
3332
html_template="sentry/integrations/notify-disable.html",
3433
text_template="sentry/integrations/notify-disable.txt",
3534
context={
36-
"integration_name": integration_name,
35+
"integration_name": integration_name.title(),
3736
"integration_link": integration_link,
3837
},
3938
).render(request)

0 commit comments

Comments
 (0)