Stop populating the notification to sender mapping table when creating a notificaiton.

This commit is contained in:
Rebecca Law
2017-11-29 16:47:23 +00:00
parent 95fd1e8c31
commit 8aa94af5d7
11 changed files with 49 additions and 468 deletions

View File

@@ -16,12 +16,11 @@ from app.models import (
)
from app.celery.tasks import update_letter_notifications_to_sent_to_dvla
from app.notifications.process_notifications import (
persist_email_reply_to_id_for_notification,
persist_notification,
persist_scheduled_notification,
send_notification_to_queue,
simulated_recipient,
persist_sms_sender_id_for_notification)
simulated_recipient
)
from app.notifications.process_letter_notifications import (
create_letter_notification
)
@@ -144,8 +143,6 @@ def process_sms_or_email_notification(*, form, notification_type, api_key, templ
reply_to_text=reply_to_text
)
persist_sender_to_notification_mapping(form, notification)
scheduled_for = form.get("scheduled_for", None)
if scheduled_for:
persist_scheduled_notification(notification.id, form["scheduled_for"])
@@ -163,15 +160,6 @@ def process_sms_or_email_notification(*, form, notification_type, api_key, templ
return notification
def persist_sender_to_notification_mapping(form, notification):
email_reply_to_id = form.get("email_reply_to_id", None)
if email_reply_to_id:
persist_email_reply_to_id_for_notification(notification.id, email_reply_to_id)
sms_sender_id = form.get("sms_sender_id", None)
if sms_sender_id:
persist_sms_sender_id_for_notification(notification.id, sms_sender_id)
def process_letter_notification(*, letter_data, api_key, template):
if api_key.key_type == KEY_TYPE_TEAM:
raise BadRequestError(message='Cannot send letters with a team api key', status_code=403)