Skip to content

Commit 40eb705

Browse files
committed
move action type to stirng out of function
1 parent 2b95360 commit 40eb705

File tree

1 file changed

+7
-6
lines changed
  • src/sentry/workflow_engine/migration_helpers

1 file changed

+7
-6
lines changed

src/sentry/workflow_engine/migration_helpers/utils.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66

77
MAX_ACTIONS = 3
88

9+
ACTION_TYPE_TO_STRING = {
10+
AlertRuleTriggerAction.Type.PAGERDUTY.value: "PagerDuty",
11+
AlertRuleTriggerAction.Type.SLACK.value: "Slack",
12+
AlertRuleTriggerAction.Type.MSTEAMS.value: "Microsoft Teams",
13+
AlertRuleTriggerAction.Type.OPSGENIE.value: "Opsgenie",
14+
}
15+
916

1017
def get_action_description(action: AlertRuleTriggerAction) -> str:
1118
"""
1219
Returns a human readable action description
1320
"""
14-
ACTION_TYPE_TO_STRING = {
15-
AlertRuleTriggerAction.Type.PAGERDUTY.value: "PagerDuty",
16-
AlertRuleTriggerAction.Type.SLACK.value: "Slack",
17-
AlertRuleTriggerAction.Type.MSTEAMS.value: "Microsoft Teams",
18-
AlertRuleTriggerAction.Type.OPSGENIE.value: "Opsgenie",
19-
}
2021

2122
if action.type == AlertRuleTriggerAction.Type.EMAIL.value:
2223
if action.target:

0 commit comments

Comments
 (0)