Skip to content

Commit

Permalink
even fewer files in the diff
Browse files Browse the repository at this point in the history
  • Loading branch information
cathteng committed Dec 12, 2024
1 parent 13f5908 commit ee6b7bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/sentry/testutils/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from django.utils.functional import cached_property

from sentry.eventstore.models import Event
from sentry.incidents.grouptype import MetricAlertFire
from sentry.incidents.models.alert_rule import AlertRule, AlertRuleMonitorTypeInt
from sentry.integrations.models.integration import Integration
from sentry.integrations.models.organization_integration import OrganizationIntegration
from sentry.issues.grouptype import ErrorGroupType
from sentry.models.activity import Activity
from sentry.models.environment import Environment
from sentry.models.grouprelease import GroupRelease
Expand Down Expand Up @@ -636,7 +636,7 @@ def create_detector(
self,
*args,
project=None,
type=MetricAlertFire.slug,
type=ErrorGroupType.slug,
**kwargs,
) -> Detector:
if project is None:
Expand Down
3 changes: 1 addition & 2 deletions src/sentry/testutils/helpers/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
from sentry.backup.validate import validate
from sentry.data_secrecy.models import DataSecrecyWaiver
from sentry.db.models.paranoia import ParanoidModel
from sentry.incidents.grouptype import MetricAlertFire
from sentry.incidents.models.alert_rule import AlertRuleMonitorTypeInt
from sentry.incidents.models.incident import (
IncidentActivity,
Expand Down Expand Up @@ -659,7 +658,7 @@ def create_exhaustive_organization(

# Setup a test 'Issue Rule' and 'Automation'
workflow = self.create_workflow(organization=org)
detector = self.create_detector(project=project, type=MetricAlertFire.slug)
detector = self.create_detector(project=project)
self.create_detector_workflow(detector=detector, workflow=workflow)
self.create_detector_state(detector=detector)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _get_validator(self, request, project, group_type_slug):
detector_type = grouptype.registry.get_by_slug(group_type_slug)
if detector_type is None:
raise ValidationError({"groupType": ["Unknown group type"]})

if detector_type.detector_validator is None:
raise ValidationError({"groupType": ["Group type not compatible with detectors"]})

Expand Down

0 comments on commit ee6b7bd

Please sign in to comment.