mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
fix 500s when inbound msgs sent from alphanumerics rather than normal phone numbers
This commit is contained in:
@@ -486,6 +486,7 @@ def send_inbound_sms_to_service(self, inbound_sms_id, service_id):
|
||||
inbound_id=inbound_sms_id)
|
||||
data = {
|
||||
"id": str(inbound_sms.id),
|
||||
# TODO: should we be validating and formatting the phone number here?
|
||||
"source_number": inbound_sms.user_number,
|
||||
"destination_number": inbound_sms.notify_number,
|
||||
"message": inbound_sms.content,
|
||||
|
||||
@@ -2,7 +2,7 @@ from urllib.parse import unquote
|
||||
|
||||
import iso8601
|
||||
from flask import jsonify, Blueprint, current_app, request, abort
|
||||
from notifications_utils.recipients import validate_and_format_phone_number
|
||||
from notifications_utils.recipients import try_validate_and_format_phone_number
|
||||
|
||||
from app import statsd_client, firetext_client, mmg_client
|
||||
from app.celery import tasks
|
||||
@@ -109,7 +109,11 @@ def format_mmg_datetime(date):
|
||||
|
||||
|
||||
def create_inbound_sms_object(service, content, from_number, provider_ref, date_received, provider_name):
|
||||
user_number = validate_and_format_phone_number(from_number, international=True)
|
||||
user_number = try_validate_and_format_phone_number(
|
||||
from_number,
|
||||
international=True,
|
||||
log_msg='Invalid from_number received'
|
||||
)
|
||||
|
||||
provider_date = date_received
|
||||
if provider_date:
|
||||
|
||||
Reference in New Issue
Block a user