Merge pull request #2637 from alphagov/check-trial-mode-uploaded-letters

Check service is not in trial mode for uploaded letters
This commit is contained in:
Katie Smith
2019-10-23 15:45:51 +01:00
committed by GitHub
2 changed files with 21 additions and 0 deletions

View File

@@ -140,6 +140,13 @@ def send_pdf_letter_notification(service_id, post_data):
check_service_has_permission(UPLOAD_LETTERS, service.permissions)
check_service_over_daily_message_limit(KEY_TYPE_NORMAL, service)
validate_created_by(service, post_data['created_by'])
validate_and_format_recipient(
send_to=post_data['filename'],
key_type=KEY_TYPE_NORMAL,
service=service,
notification_type=LETTER_TYPE,
allow_whitelisted_recipients=False,
)
template = get_precompiled_letter_template(service.id)
file_location = 'service-{}/{}.pdf'.format(service.id, post_data['file_id'])