Merge pull request #1075 from alphagov/letter-api-refactor

Letter api step 1 - refactor
This commit is contained in:
Leo Hemsted
2017-07-25 14:53:39 +01:00
committed by GitHub
9 changed files with 402 additions and 100 deletions

View File

@@ -36,6 +36,7 @@ def check_placeholders(template_object):
def persist_notification(
*,
template_id,
template_version,
recipient,

View File

@@ -9,7 +9,7 @@ from notifications_utils.clients.redis import rate_limit_cache_key, daily_limit_
from app.dao import services_dao, templates_dao
from app.models import (
INTERNATIONAL_SMS_TYPE, SMS_TYPE,
INTERNATIONAL_SMS_TYPE, SMS_TYPE, EMAIL_TYPE,
KEY_TYPE_TEST, KEY_TYPE_TEAM, SCHEDULE_NOTIFICATIONS
)
from app.service.utils import service_allowed_to_send_to
@@ -104,7 +104,7 @@ def validate_and_format_recipient(send_to, key_type, service, notification_type)
number=send_to,
international=international_phone_info.international
)
else:
elif notification_type == EMAIL_TYPE:
return validate_and_format_email_address(email_address=send_to)