make persist_notification require kwargs

when functions get as big as that, it's confusing to try and work out what
things are what. By including a * as the first arg, we require that anyone
calling the function has to use kwargs to reference the parameters
This commit is contained in:
Leo Hemsted
2017-07-07 17:10:25 +01:00
parent 2be194d9ce
commit 9caf45451e
5 changed files with 70 additions and 25 deletions

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)