def delete(self, request, installation):
        if not features.has('organizations:internal-catchall',
                            installation.organization):
            return Response(status=404)

        Destroyer.run(install=installation)
        return Response(status=204)
 def delete(self, request, installation):
     Destroyer.run(
         install=installation,
         user=request.user,
         request=request,
     )
     return Response(status=204)
    def delete(self, request, installation):
        if not features.has('organizations:internal-catchall',
                            installation.organization,
                            actor=request.user):
            return Response(status=404)

        Destroyer.run(install=installation)
        return Response(status=204)
Esempio n. 4
0
 def test_notify_false_does_not_send_notification(self, run):
     with self.tasks():
         responses.add(responses.POST, "https://example.com/webhook")
         request = self.make_request(user=self.user, method="GET")
         Destroyer.run(install=self.install,
                       user=self.user,
                       request=request,
                       notify=False)
         assert not run.called
Esempio n. 5
0
 def test_creates_audit_log_entry(self):
     responses.add(responses.POST, 'https://example.com/webhook')
     request = self.make_request(user=self.user, method='GET')
     Destroyer.run(
         install=self.install,
         user=self.user,
         request=request,
     )
     assert AuditLogEntry.objects.filter(event=AuditLogEntryEvent.SENTRY_APP_UNINSTALL).exists()
Esempio n. 6
0
 def test_sends_notification(self, run):
     with self.tasks():
         responses.add(responses.POST, "https://example.com/webhook")
         request = self.make_request(user=self.user, method="GET")
         Destroyer.run(install=self.install,
                       user=self.user,
                       request=request)
         run.assert_called_once_with(install=self.install,
                                     user=self.user,
                                     action="deleted")
Esempio n. 7
0
 def test_creates_audit_log_entry(self):
     responses.add(responses.POST, 'https://example.com/webhook')
     request = self.make_request(user=self.user, method='GET')
     Destroyer.run(
         install=self.install,
         user=self.user,
         request=request,
     )
     assert AuditLogEntry.objects.filter(
         event=AuditLogEntryEvent.SENTRY_APP_UNINSTALL).exists()
    def delete(self, request, installation):
        if not features.has('organizations:sentry-apps',
                            installation.organization,
                            actor=request.user):
            return Response(status=404)

        Destroyer.run(
            install=installation,
            user=request.user,
        )
        return Response(status=204)
    def delete(self, request, organization, uuid):
        try:
            install = SentryAppInstallation.objects.get(
                organization=organization,
                uuid=uuid,
            )
        except SentryAppInstallation.DoesNotExist:
            return Response(status=404)

        Destroyer.run(install=install)
        return Response(status=204)
Esempio n. 10
0
    def test_records_analytics(self, record):
        responses.add(responses.POST, "https://example.com/webhook")

        Destroyer.run(
            install=self.install,
            user=self.user,
            request=self.make_request(user=self.user, method="GET"),
        )

        record.assert_called_with(
            "sentry_app.uninstalled",
            user_id=self.user.id,
            organization_id=self.org.id,
            sentry_app=self.install.sentry_app.slug,
        )
Esempio n. 11
0
    def test_records_analytics(self, record):
        responses.add(responses.POST, 'https://example.com/webhook')

        Destroyer.run(
            install=self.install,
            user=self.user,
            request=self.make_request(user=self.user, method='GET'),
        )

        record.assert_called_with(
            'sentry_app.uninstalled',
            user_id=self.user.id,
            organization_id=self.org.id,
            sentry_app=self.install.sentry_app.slug,
        )