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 (#1798)
returns "None" the previous plugin data are not commited to database.
This commit is contained in:
parent
29e07d73e1
commit
09c2af526b
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue