Merge branch 'master' into rate-limit-api-calls

Conflicts:
	requirements.txt
	tests/app/notifications/rest/test_send_notification.py
	tests/app/notifications/test_validators.py
	tests/app/v2/notifications/test_post_notifications.py
This commit is contained in:
Martyn Inglis
2017-05-02 10:56:56 +01:00
49 changed files with 1279 additions and 203 deletions

View File

@@ -31,6 +31,7 @@ def post_notification(notification_type):
form = validate(request.get_json(), post_email_request)
else:
form = validate(request.get_json(), post_sms_request)
service = services_dao.dao_fetch_service_by_id(api_user.service_id)
check_rate_limiting(service, api_user)
@@ -48,7 +49,7 @@ def post_notification(notification_type):
notification = persist_notification(template_id=template.id,
template_version=template.version,
recipient=send_to,
recipient=form_send_to,
service=service,
personalisation=form.get('personalisation', None),
notification_type=notification_type,