Skip to content
Snippets Groups Projects
Commit d80cc7b1 authored by Daniel Lyons's avatar Daniel Lyons
Browse files

Ensure that all of the templates have a To: header

parent d3adfa9f
No related branches found
No related tags found
Loading
Pipeline #2434 passed
"""add To: to notification templates
Revision ID: 5aafb3c0172e
Revises: d6d6c2ffaa66
Create Date: 2021-08-05 14:46:56.428074
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5aafb3c0172e'
down_revision = 'd6d6c2ffaa66'
branch_labels = None
depends_on = None
def upgrade():
op.execute("""
update notification_templates
set template = E'To: {{destination_email}}\n' || template
where template not like E'To: {{destination_email}}\n%'
""")
def downgrade():
op.execute("""
update notification_templates
set template = regexp_replace(template, E'^To: {{destination_email}}\n', '')
where template like E'To: {{destination_email}}\n%'
""")
\ No newline at end of file
......@@ -73,9 +73,7 @@ class NotificationServiceRESTClient(NotificationServiceIF):
:param request: Capability request
"""
logger.info("SENDING QA-READY NOTIFICATION!!!")
analyst_email = (
CapoConfig().settings("edu.nrao.workspaces.NotificationSettings").analystEmail
)
analyst_email = CapoConfig().settings("edu.nrao.workspaces.NotificationSettings").analystEmail
requests.post(
f"{self.url}/notify/ready-for-QA_email/send",
json={
......@@ -87,7 +85,7 @@ class NotificationServiceRESTClient(NotificationServiceIF):
)
class NotificationService(NotificationServiceIF):
class NotificationService:
def __init__(self, info: NotificationInfoIF):
self.info = info
......
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