Skip to content

Commit 6006635

Browse files
committed
♻️ ref: revert to using data source type
1 parent 3849cc4 commit 6006635

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sentry/workflow_engine/handlers/action/notification.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from sentry.eventstore.models import GroupEvent
22
from sentry.workflow_engine.actions.notification_action import send_notification_using_rule_registry
3-
from sentry.workflow_engine.models import Action, Detector
3+
from sentry.workflow_engine.models import Action, DataSource, Detector
44
from sentry.workflow_engine.registry import action_handler_registry
5-
from sentry.workflow_engine.types import ActionHandler, DetectorType
5+
from sentry.workflow_engine.types import ActionHandler
66

77

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

27-
if detector.type == DetectorType.ERROR:
27+
data_source = DataSource.objects.get(id=action.data_source_id)
28+
29+
if data_source.type == "IssueOccurrence":
2830
# We should use the legacy issue alert notification logic
2931
send_notification_using_rule_registry(action, detector, group_event)
3032
else:

0 commit comments

Comments
 (0)