From f9591a8088bab2cc28c26e8684a695741669fc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Pr=C3=A9mel-Cabic?= Date: Wed, 27 Mar 2024 17:33:50 +0100 Subject: [PATCH] fix: set scope_id property for project scoped abuse quota --- src/sentry/quotas/redis.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sentry/quotas/redis.py b/src/sentry/quotas/redis.py index 8ef3f3eda31a00..355bb7d9836d9d 100644 --- a/src/sentry/quotas/redis.py +++ b/src/sentry/quotas/redis.py @@ -66,7 +66,11 @@ def get_quotas( if key: key.project = project - results = [*self.get_abuse_quotas(project.organization)] + results = [] + for quota in self.get_abuse_quotas(project.organization): + if quota.scope == QuotaScope.PROJECT: + quota.scope_id = project.id + results.append(quota) # If the organization belongs to the disabled list, we want to stop ingesting custom metrics. if project.organization.id in (options.get("custom-metrics-ingestion-disabled-orgs") or ()):