Browse Source

Revert "feat(uptime): Call quotas.disable_seat when deleting monitors (#84263)"

This reverts commit a479a30cece154804492f7c3bea9eb3db630e4c8.

Co-authored-by: hubertdeng123 <25517925+hubertdeng123@users.noreply.github.com>
getsentry-bot 1 month ago
parent
commit
e5610c7b9b

+ 0 - 1
src/sentry/uptime/subscriptions/subscriptions.py

@@ -401,7 +401,6 @@ def delete_uptime_subscriptions_for_project(
 
 def delete_project_uptime_subscription(subscription: ProjectUptimeSubscription):
     uptime_subscription = subscription.uptime_subscription
-    quotas.backend.disable_seat(DataCategory.UPTIME, subscription)
     subscription.delete()
     remove_uptime_subscription_if_unused(uptime_subscription)
 

+ 2 - 6
tests/sentry/uptime/subscriptions/test_subscriptions.py

@@ -644,8 +644,7 @@ class DeleteUptimeSubscriptionsForProjectTest(UptimeTestCase):
 
 
 class DeleteProjectUptimeSubscriptionTest(UptimeTestCase):
-    @mock.patch("sentry.quotas.backend.disable_seat")
-    def test_other_subscriptions(self, mock_disable_seat):
+    def test_other_subscriptions(self):
         other_project = self.create_project()
         proj_sub = get_or_create_project_uptime_subscription(
             self.project,
@@ -674,10 +673,8 @@ class DeleteProjectUptimeSubscriptionTest(UptimeTestCase):
             proj_sub.refresh_from_db()
 
         assert UptimeSubscription.objects.filter(id=other_sub.uptime_subscription_id).exists()
-        mock_disable_seat.assert_called_with(DataCategory.UPTIME, proj_sub)
 
-    @mock.patch("sentry.quotas.backend.disable_seat")
-    def test_single_subscriptions(self, mock_disable_seat):
+    def test_single_subscriptions(self):
         proj_sub = get_or_create_project_uptime_subscription(
             self.project,
             self.environment,
@@ -694,7 +691,6 @@ class DeleteProjectUptimeSubscriptionTest(UptimeTestCase):
 
         with pytest.raises(UptimeSubscription.DoesNotExist):
             proj_sub.uptime_subscription.refresh_from_db()
-        mock_disable_seat.assert_called_with(DataCategory.UPTIME, proj_sub)
 
 
 class RemoveUptimeSubscriptionIfUnusedTest(UptimeTestCase):