Skip to content

Commit

Permalink
♻️ ref: revert to using data source type
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrajjoshi committed Dec 9, 2024
1 parent 3849cc4 commit 6006635
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/sentry/workflow_engine/handlers/action/notification.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from sentry.eventstore.models import GroupEvent
from sentry.workflow_engine.actions.notification_action import send_notification_using_rule_registry
from sentry.workflow_engine.models import Action, Detector
from sentry.workflow_engine.models import Action, DataSource, Detector
from sentry.workflow_engine.registry import action_handler_registry
from sentry.workflow_engine.types import ActionHandler, DetectorType
from sentry.workflow_engine.types import ActionHandler


@action_handler_registry.register(Action.Type.NOTIFICATION)
Expand All @@ -24,7 +24,9 @@ def execute(
# TODO(iamrajjoshi): Add a check to see if the detector belongs to the same project as the group_event
assert detector.project == group_event.project

if detector.type == DetectorType.ERROR:
data_source = DataSource.objects.get(id=action.data_source_id)

if data_source.type == "IssueOccurrence":
# We should use the legacy issue alert notification logic
send_notification_using_rule_registry(action, detector, group_event)
else:
Expand Down

0 comments on commit 6006635

Please sign in to comment.