mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
block one-off sms with long content counts
This commit is contained in:
@@ -595,6 +595,6 @@ def handle_sql_errror(e):
|
||||
|
||||
|
||||
@service_blueprint.route('/<uuid:service_id>/send-notification', methods=['POST'])
|
||||
def post_notification(service_id):
|
||||
def create_one_off_notification(service_id):
|
||||
resp = send_one_off_notification(service_id, request.get_json())
|
||||
return jsonify(resp), 201
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from app.config import QueueNames
|
||||
from app.notifications.validators import (
|
||||
check_service_over_daily_message_limit,
|
||||
check_sms_content_char_count,
|
||||
validate_and_format_recipient,
|
||||
validate_template,
|
||||
)
|
||||
from app.notifications.process_notifications import (
|
||||
create_content_for_notification,
|
||||
@@ -27,9 +27,7 @@ def send_one_off_notification(service_id, post_data):
|
||||
|
||||
personalisation = post_data.get('personalisation', None)
|
||||
|
||||
if template.template_type == SMS_TYPE:
|
||||
template_with_content = create_content_for_notification(template, personalisation)
|
||||
check_sms_content_char_count(template_with_content.content_count)
|
||||
validate_template(template.id, personalisation, service, template.template_type)
|
||||
|
||||
check_service_over_daily_message_limit(KEY_TYPE_NORMAL, service)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user