We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e4a0d4 commit f222b77Copy full SHA for f222b77
src/sentry/api/endpoints/project_rules.py
@@ -236,9 +236,12 @@ def find_duplicate(self) -> Rule | None:
236
"""
237
Determines whether specified rule already exists, and if it does, returns it.
238
239
- existing_rules = Rule.objects.exclude(id=self._rule_id).filter(
240
- project__id=self._project_id, status=ObjectStatus.ACTIVE
241
- )
+ if self._rule_id is None:
+ all_rules = Rule.objects.all()
+ else:
242
+ all_rules = Rule.objects.exclude(id=self._rule_id)
243
+
244
+ existing_rules = all_rules.filter(project__id=self._project_id, status=ObjectStatus.ACTIVE)
245
for existing_rule in existing_rules:
246
keys_checked = 0
247
keys_matched = 0
0 commit comments