server-tools/scheduler_error_mailer/migrations/12.0.1.1.0/post-migration.py

14 lines
449 B
Python

# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
template = env.ref("scheduler_error_mailer.scheduler_error_mailer")
template.body_html = template.body_html.replace(
"${ctx.get('job_exception') and ctx.get('job_exception').value",
"${ctx.get('job_exception')"
)