mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 05:58:53 -04:00
Merge branch 'master' into remove-failed-as-a-status
This commit is contained in:
@@ -47,7 +47,7 @@ def validate_schema(schema):
|
||||
@validate_schema(dvla_sns_callback_schema)
|
||||
def process_letter_response():
|
||||
req_json = request.get_json(force=True)
|
||||
current_app.logger.info('Received SNS callback: {}'.format(req_json))
|
||||
current_app.logger.debug('Received SNS callback: {}'.format(req_json))
|
||||
if not autoconfirm_subscription(req_json):
|
||||
# The callback should have one record for an S3 Put Event.
|
||||
message = json.loads(req_json['Message'])
|
||||
|
||||
@@ -26,7 +26,7 @@ def process_mmg_response():
|
||||
|
||||
safe_to_log = data.copy()
|
||||
safe_to_log.pop("MSISDN")
|
||||
current_app.logger.info(
|
||||
current_app.logger.debug(
|
||||
"Full delivery response from {} for notification: {}\n{}".format(client_name, request.form.get('CID'),
|
||||
safe_to_log))
|
||||
if errors:
|
||||
@@ -45,7 +45,7 @@ def process_firetext_response():
|
||||
raise InvalidRequest(errors, status_code=400)
|
||||
safe_to_log = dict(request.form).copy()
|
||||
safe_to_log.pop('mobile')
|
||||
current_app.logger.info(
|
||||
current_app.logger.debug(
|
||||
"Full delivery response from {} for notification: {}\n{}".format(client_name, request.form.get('reference'),
|
||||
safe_to_log))
|
||||
success, errors = process_sms_client_response(status=request.form.get('status'),
|
||||
|
||||
@@ -133,7 +133,7 @@ def send_notification_to_queue(notification, research_mode, queue=None):
|
||||
dao_delete_notifications_and_history_by_id(notification.id)
|
||||
raise
|
||||
|
||||
current_app.logger.info(
|
||||
current_app.logger.debug(
|
||||
"{} {} sent to the {} queue for delivery".format(notification.notification_type,
|
||||
notification.id,
|
||||
queue))
|
||||
|
||||
@@ -59,7 +59,7 @@ def receive_mmg_sms():
|
||||
|
||||
tasks.send_inbound_sms_to_service.apply_async([str(inbound.id), str(service.id)], queue=QueueNames.NOTIFY)
|
||||
|
||||
current_app.logger.info(
|
||||
current_app.logger.debug(
|
||||
'{} received inbound SMS with reference {} from MMG'.format(service.id, inbound.provider_reference))
|
||||
return jsonify({
|
||||
"status": "ok"
|
||||
@@ -96,7 +96,7 @@ def receive_firetext_sms():
|
||||
statsd_client.incr('inbound.firetext.successful')
|
||||
|
||||
tasks.send_inbound_sms_to_service.apply_async([str(inbound.id), str(service.id)], queue=QueueNames.NOTIFY)
|
||||
current_app.logger.info(
|
||||
current_app.logger.debug(
|
||||
'{} received inbound SMS with reference {} from Firetext'.format(service.id, inbound.provider_reference))
|
||||
return jsonify({
|
||||
"status": "ok"
|
||||
|
||||
@@ -138,7 +138,7 @@ def send_notification(notification_type):
|
||||
research_mode=authenticated_service.research_mode,
|
||||
queue=queue_name)
|
||||
else:
|
||||
current_app.logger.info("POST simulated notification for id: {}".format(notification_model.id))
|
||||
current_app.logger.debug("POST simulated notification for id: {}".format(notification_model.id))
|
||||
notification_form.update({"template_version": template.version})
|
||||
|
||||
return jsonify(
|
||||
|
||||
@@ -20,6 +20,6 @@ def confirm_subscription(confirmation_request):
|
||||
|
||||
def autoconfirm_subscription(req_json):
|
||||
if req_json.get('Type') == 'SubscriptionConfirmation':
|
||||
current_app.logger.info("SNS subscription confirmation url: {}".format(req_json['SubscribeURL']))
|
||||
current_app.logger.debug("SNS subscription confirmation url: {}".format(req_json['SubscribeURL']))
|
||||
subscribed_topic = confirm_subscription(req_json)
|
||||
return subscribed_topic
|
||||
|
||||
Reference in New Issue
Block a user