Merge pull request #991 from alphagov/invite-service-to-schedule

Invite the service to schedule notifications from the API
This commit is contained in:
Rebecca Law
2017-06-01 12:37:32 +01:00
committed by GitHub
6 changed files with 51 additions and 22 deletions

View File

@@ -35,9 +35,8 @@ def post_notification(notification_type):
form = validate(request.get_json(), post_sms_request)
scheduled_for = form.get("scheduled_for", None)
if scheduled_for:
if not service_can_schedule_notification(authenticated_service):
return
service_can_schedule_notification(authenticated_service, scheduled_for)
check_rate_limiting(authenticated_service, api_user)
form_send_to = form['phone_number'] if notification_type == SMS_TYPE else form['email_address']