Skip to content
Snippets Groups Projects
Commit 544676ee authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Changed the subject line for the pims notification to indicate if the job finished or failed

parent 0959ffa8
No related branches found
No related tags found
2 merge requests!1607merge 2.8.3 to main,!1586WS-1879 PIMS notification subject
"""pims_notification_subject
Revision ID: f06f1976489c
Revises: 008590dd66fd
Create Date: 2024-02-20 10:28:45.614867
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f06f1976489c'
down_revision = '008590dd66fd'
branch_labels = None
depends_on = None
old_subject = """Subject: PIMS Split Workflow Finished
"""
new_subject = """Subject: PIMS Split Workflow {{#failed_splits.0}}Failed{{/failed_splits.0}}{{^failed_splits}}Finished{{/failed_splits}}
"""
def upgrade():
op.execute(
f"""
UPDATE notification_templates
SET template=replace(template, E'{old_subject}', E'{new_subject}')
WHERE name='pims_notification'
"""
)
def downgrade():
op.execute(
f"""
UPDATE notification_templates
SET template=replace(template, E'{new_subject}', E'{old_subject}')
WHERE name='pims_notification'
"""
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment