0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-03-12 20:46:49 +00:00

fix(plugin): fixes an issue if the last plugin in the order ()

returns "None" the previous plugin data
are not commited to database.
This commit is contained in:
Esben Laursen 2023-02-27 20:00:34 +01:00 committed by GitHub
parent 29e07d73e1
commit 09c2af526b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,7 +66,7 @@ def process_alert(alert: Alert) -> Alert:
wanted_plugins, wanted_config = plugins.routing(alert)
updated = None
alert_was_updated: bool = False
for plugin in wanted_plugins:
if skip_plugins:
break
@ -83,8 +83,9 @@ def process_alert(alert: Alert) -> Alert:
logging.error(f"Error while running post-receive plugin '{plugin.name}': {str(e)}")
if updated:
alert = updated
alert_was_updated = True
if updated:
if alert_was_updated:
alert.update_tags(alert.tags)
alert.attributes = alert.update_attributes(alert.attributes)