mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Update to processing the the response from MMG
MMG changed the datatype and the status codes they send us for the delivery receipts. This PR accounts for that change.
This commit is contained in:
@@ -12,7 +12,7 @@ sms_response_mapper = {'MMG': get_mmg_responses,
|
||||
def validate_callback_data(data, fields, client_name):
|
||||
errors = []
|
||||
for f in fields:
|
||||
if len(data.get(f, '')) <= 0:
|
||||
if not str(data.get(f, '')):
|
||||
error = "{} callback failed: {} missing".format(client_name, f)
|
||||
errors.append(error)
|
||||
return errors if len(errors) > 0 else None
|
||||
|
||||
@@ -147,7 +147,7 @@ def process_mmg_response():
|
||||
[current_app.logger.info(e) for e in validation_errors]
|
||||
return jsonify(result='error', message=validation_errors), 400
|
||||
|
||||
success, errors = process_sms_client_response(status=data.get('status'),
|
||||
success, errors = process_sms_client_response(status=str(data.get('status')),
|
||||
reference=data.get('CID'),
|
||||
client_name='MMG')
|
||||
if errors:
|
||||
|
||||
Reference in New Issue
Block a user