notify-api-521 code review feedback and fix code coverage

This commit is contained in:
Kenneth Kehl
2023-10-03 07:31:24 -07:00
parent 2487aeb657
commit 6af998a080
2 changed files with 6 additions and 13 deletions

View File

@@ -2,9 +2,8 @@ import json
import os import os
import re import re
import time import time
from datetime import datetime from datetime import datetime, timedelta
from _datetime import timedelta
from boto3 import client from boto3 import client
from flask import current_app from flask import current_app

View File

@@ -54,19 +54,13 @@ def receive_sns_sms():
) )
return jsonify(result="success", message="SMS-SNS callback succeeded"), 200 return jsonify(result="success", message="SMS-SNS callback succeeded"), 200
content = message.get("messageBody")
from_number = message.get("originationNumber")
provider_ref = message.get("inboundMessageId")
date_received = post_data.get("Timestamp")
provider_name = "sns"
inbound = create_inbound_sms_object( inbound = create_inbound_sms_object(
service, service,
content=content, content=message.get("messageBody"),
from_number=from_number, from_number=message.get("originationNumber"),
provider_ref=provider_ref, provider_ref=message.get("inboundMessageId"),
date_received=date_received, date_received=post_data.get("Timestamp"),
provider_name=provider_name, provider_name="sns",
) )
tasks.send_inbound_sms_to_service.apply_async( tasks.send_inbound_sms_to_service.apply_async(