diff --git a/app/notifications/notifications_sms_callback.py b/app/notifications/notifications_sms_callback.py index 430e1c149..5120a48c8 100644 --- a/app/notifications/notifications_sms_callback.py +++ b/app/notifications/notifications_sms_callback.py @@ -24,9 +24,11 @@ def process_mmg_response(): reference=data.get('CID'), client_name=client_name) + safe_to_log = data.copy() + safe_to_log.pop("MSISDN") current_app.logger.info( - "Full delivery response from {} for notification: {}\n{}".format(client_name, request.form.get('reference'), - request.form)) + "Full delivery response from {} for notification: {}\n{}".format(client_name, request.form.get('CID'), + safe_to_log)) if errors: raise InvalidRequest(errors, status_code=400) else: @@ -41,12 +43,12 @@ def process_firetext_response(): client_name=client_name) if errors: raise InvalidRequest(errors, status_code=400) - - status = request.form.get('status') + safe_to_log = dict(request.form).copy() + safe_to_log.pop('mobile') current_app.logger.info( "Full delivery response from {} for notification: {}\n{}".format(client_name, request.form.get('reference'), - request.form)) - success, errors = process_sms_client_response(status=status, + safe_to_log)) + success, errors = process_sms_client_response(status=request.form.get('status'), reference=request.form.get('reference'), client_name=client_name) if errors: