Skip to content
Snippets Groups Projects

Update the QA pass template to work with non-srdp as well (ignore the branch/migration misnomer)

Merged Nathan Bockisch requested to merge fix-qa-fail-template-custom-text into main
1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
"""make sure qa fail custom text is in srdp and non srdp sections
Revision ID: d20ceed949b3
Revises: 569416c40ca8
Create Date: 2023-09-29 12:27:27.449396
"""
from pathlib import Path
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "d20ceed949b3"
down_revision = "569416c40ca8"
branch_labels = None
depends_on = None
template_name = "std_calibration_complete"
old_content = (Path.cwd() / "versions" / "templates" / "emails" / "std_calibration_complete_newer.txt").read_text()
new_content = (
Path.cwd() / "versions" / "templates" / "emails" / "std_calibration_complete_non_srdp_custom_text.txt"
).read_text()
def upgrade():
op.execute(
f"""
UPDATE notification_templates
SET template=E'{new_content}'
WHERE name=E'{template_name}'
"""
)
def downgrade():
op.execute(
f"""
UPDATE notification_templates
SET template=E'{old_content}'
WHERE name=E'{template_name}'
"""
)
Loading