Skip to content

Commit

Permalink
ref: fix nullability in alert_rule serializer (#73791)
Browse files Browse the repository at this point in the history
<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored Jul 22, 2024
1 parent eee7e63 commit 5e26f16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sentry/incidents/endpoints/serializers/alert_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ def get_attrs(
)
}
for rule_activity in rule_activities:
rpc_user = user_by_user_id.get(rule_activity.user_id)
if rule_activity.user_id is not None:
rpc_user = user_by_user_id.get(rule_activity.user_id)
else:
rpc_user = None
if rpc_user:
created_by = dict(
id=rpc_user.id, name=rpc_user.get_display_name(), email=rpc_user.email
Expand Down

0 comments on commit 5e26f16

Please sign in to comment.