File tree 1 file changed +3
-1
lines changed
src/sentry/workflow_engine
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -78,11 +78,13 @@ def create_metric_data_condition(alert_rule_trigger: AlertRuleTrigger) -> None:
78
78
else DetectorPriorityLevel .HIGH
79
79
)
80
80
threshold_type = alert_rule_trigger .alert_rule .threshold_type
81
+ if not threshold_type :
82
+ return None
81
83
# XXX: we read the threshold type off of the alert_rule and NOT the alert_rule_trigger
82
84
# alert_rule_trigger.threshold_type is a deprecated feature we are not moving over
83
85
84
86
data_condition = DataCondition .objects .create (
85
- condition = threshold_to_condition [ threshold_type ] ,
87
+ condition = threshold_to_condition . get ( threshold_type , AlertRuleThresholdType . ABOVE . value ) ,
86
88
comparison = alert_rule_trigger .alert_threshold ,
87
89
condition_result = condition_result ,
88
90
type = ConditionType .METRIC_CONDITION ,
You can’t perform that action at this time.
0 commit comments