Skip to content

Commit 45be82f

Browse files
committed
Simplify conversion from alert names to ids
1 parent 9de939c commit 45be82f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

simvue/run.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,9 +1639,7 @@ def add_alerts(
16391639
if names and not ids:
16401640
try:
16411641
if alerts := Alert.get(offline=self._user_config.run.mode == "offline"):
1642-
for alert in alerts:
1643-
if alert[1].name in names:
1644-
ids.append(alert[1].id)
1642+
ids += [id for id, alert in alerts if alert.name in names]
16451643
else:
16461644
self._error("No existing alerts")
16471645
return False

0 commit comments

Comments
 (0)