Skip to content

Commit 0e8fc4f

Browse files
committed
delete
1 parent 1544791 commit 0e8fc4f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/sentry/workflow_engine/endpoints/organization_detector_details.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,7 @@ def delete(self, request: Request, organization: Organization, detector: Detecto
242242
243243
Delete a monitor
244244
"""
245+
# Intentionally no _check_metric_detector_allowed gate here:
246+
# orgs should be able to delete detectors they can no longer use
247+
# (e.g. after a plan downgrade).
245248
return remove_detector(request, organization, detector)

tests/sentry/workflow_engine/endpoints/test_organization_detector_details.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,15 @@ def test_simple(self, mock_schedule_update_project_config: mock.MagicMock) -> No
10541054
assert self.detector.status == ObjectStatus.PENDING_DELETION
10551055
mock_schedule_update_project_config.assert_called_once_with(self.detector)
10561056

1057+
def test_delete_allowed_without_metric_subscription_feature(self) -> None:
1058+
with self.feature({"organizations:incidents": False}):
1059+
with outbox_runner():
1060+
self.get_success_response(self.organization.slug, self.detector.id)
1061+
1062+
assert CellScheduledDeletion.objects.filter(
1063+
model_name="Detector", object_id=self.detector.id
1064+
).exists()
1065+
10571066
def test_error_group_type(self) -> None:
10581067
"""
10591068
Test that we do not delete the required error detector

0 commit comments

Comments
 (0)