mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
notify-admin-768 initial
This commit is contained in:
@@ -31,6 +31,7 @@ from app.models import (
|
|||||||
)
|
)
|
||||||
from app.notifications.process_notifications import persist_notification
|
from app.notifications.process_notifications import persist_notification
|
||||||
from app.notifications.validators import check_service_over_total_message_limit
|
from app.notifications.validators import check_service_over_total_message_limit
|
||||||
|
from app.schema_validation.definitions import uuid
|
||||||
from app.serialised_models import SerialisedService, SerialisedTemplate
|
from app.serialised_models import SerialisedService, SerialisedTemplate
|
||||||
from app.service.utils import service_allowed_to_send_to
|
from app.service.utils import service_allowed_to_send_to
|
||||||
from app.utils import DATETIME_FORMAT
|
from app.utils import DATETIME_FORMAT
|
||||||
@@ -193,6 +194,12 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
job_id = notification.get("job", None)
|
||||||
|
created_by_id = None
|
||||||
|
if job_id:
|
||||||
|
job = dao_get_job_by_id(job_id)
|
||||||
|
created_by_id = job.created_by_id
|
||||||
|
|
||||||
saved_notification = persist_notification(
|
saved_notification = persist_notification(
|
||||||
template_id=notification["template"],
|
template_id=notification["template"],
|
||||||
template_version=notification["template_version"],
|
template_version=notification["template_version"],
|
||||||
@@ -203,6 +210,7 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i
|
|||||||
api_key_id=None,
|
api_key_id=None,
|
||||||
key_type=KEY_TYPE_NORMAL,
|
key_type=KEY_TYPE_NORMAL,
|
||||||
created_at=datetime.utcnow(),
|
created_at=datetime.utcnow(),
|
||||||
|
created_by_id=uuid.UUID(created_by_id),
|
||||||
job_id=notification.get("job", None),
|
job_id=notification.get("job", None),
|
||||||
job_row_number=notification.get("row_number", None),
|
job_row_number=notification.get("row_number", None),
|
||||||
notification_id=notification_id,
|
notification_id=notification_id,
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ from flask import current_app
|
|||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
revision = '0402_total_message_limit_default'
|
revision = "0402_total_message_limit_default"
|
||||||
down_revision = '0401_add_e2e_test_user'
|
down_revision = "0401_add_e2e_test_user"
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
|||||||
Reference in New Issue
Block a user