mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-10 15:22:24 -05:00
reformat
This commit is contained in:
@@ -11,39 +11,51 @@ from datetime import datetime
|
||||
|
||||
from sqlalchemy import text
|
||||
|
||||
revision = '0374_fix_reg_template_history'
|
||||
down_revision = '0373_add_notifications_view'
|
||||
revision = "0374_fix_reg_template_history"
|
||||
down_revision = "0373_add_notifications_view"
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
service_id = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553'
|
||||
user_id= '6af522d0-2915-4e52-83a3-3690455a5fe6'
|
||||
service_id = "d6aa2c68-a2d9-4437-ab19-3ae8eb202553"
|
||||
user_id = "6af522d0-2915-4e52-83a3-3690455a5fe6"
|
||||
|
||||
|
||||
def upgrade():
|
||||
conn = op.get_bind()
|
||||
|
||||
|
||||
# modify subject of verification email in templates
|
||||
conn.execute("update templates set subject='Confirm US Notify registration' "
|
||||
"where name = 'Notify email verification code'")
|
||||
|
||||
conn.execute(
|
||||
"update templates set subject='Confirm US Notify registration' "
|
||||
"where name = 'Notify email verification code'"
|
||||
)
|
||||
|
||||
# modify subject of verification email in templates_history
|
||||
conn.execute("update templates_history set subject='Confirm US Notify registration' "
|
||||
"where name = 'Notify email verification code'")
|
||||
|
||||
conn.execute(
|
||||
"update templates_history set subject='Confirm US Notify registration' "
|
||||
"where name = 'Notify email verification code'"
|
||||
)
|
||||
|
||||
val = """Hi ((name)),\n\nTo complete your registration for US Notify please click the link below\n\n((url))"""
|
||||
input_params = {
|
||||
"val": val
|
||||
}
|
||||
conn.execute(text("update templates set content=:val where name = 'Notify email verification code'"), input_params)
|
||||
|
||||
input_params = {"val": val}
|
||||
conn.execute(
|
||||
text(
|
||||
"update templates set content=:val where name = 'Notify email verification code'"
|
||||
),
|
||||
input_params,
|
||||
)
|
||||
|
||||
# modify content of verification email in templates_history
|
||||
# table_name = 'templates_history'
|
||||
conn.execute(text("update templates_history set content=:val where name = 'Notify email verification code'"), input_params)
|
||||
|
||||
conn.execute(
|
||||
text(
|
||||
"update templates_history set content=:val where name = 'Notify email verification code'"
|
||||
),
|
||||
input_params,
|
||||
)
|
||||
|
||||
# TODO: modify other templates as necessary and re-run this migration
|
||||
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
||||
Reference in New Issue
Block a user