|
3 | 3 |
|
4 | 4 | from sentry.constants import SentryAppStatus
|
5 | 5 | from sentry.integrations.notify_disable import get_provider_type, get_url
|
6 |
| -from sentry.models import Organization, SentryApp |
| 6 | +from sentry.models import Organization, SentryApp, SentryAppInstallation |
7 | 7 |
|
8 | 8 | from .mail import MailPreview
|
9 | 9 |
|
10 | 10 |
|
11 | 11 | class DebugSentryAppNotifyDisableView(View):
|
12 | 12 | def get(self, request: HttpRequest) -> HttpResponse:
|
13 | 13 |
|
14 |
| - self.organization = Organization(id=1, slug="organization", name="My Company") |
| 14 | + self.organization = Organization(id=1, slug="sentry", name="My Company") |
15 | 15 | self.sentry_app = SentryApp(
|
16 | 16 | name="Test App",
|
17 | 17 | events=["issue.resolved", "issue.ignored", "issue.assigned"],
|
18 | 18 | status=SentryAppStatus.INTERNAL,
|
19 | 19 | webhook_url="https://broken-example.com/webhook",
|
| 20 | + slug="internal-35e455", |
| 21 | + ) |
| 22 | + self.install = SentryAppInstallation( |
| 23 | + organization_id=self.organization.id, sentry_app=self.sentry_app |
20 | 24 | )
|
21 | 25 |
|
| 26 | + redis_key = f"sentry-app-error:{self.install.uuid}" |
22 | 27 | integration_name = self.sentry_app.name
|
23 | 28 | integration_link = get_url(
|
24 | 29 | self.organization,
|
25 |
| - get_provider_type(f"sentry-app-error:{self.sentry_app.uuid}"), |
| 30 | + get_provider_type(redis_key), |
26 | 31 | self.sentry_app.slug,
|
27 | 32 | )
|
28 |
| - redis_key = f"sentry-app-error:{self.sentry_app.uuid}" |
29 |
| - |
30 | 33 | return MailPreview(
|
31 | 34 | html_template="sentry/integrations/sentry-app-notify-disable.html",
|
32 | 35 | text_template="sentry/integrations/sentry-app-notify-disable.txt",
|
|
0 commit comments