mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 15:56:45 -04:00
Merge pull request #802 from alphagov/return-200-for-duplicate-callback
Return success of the callback is a duplicate or for an id that does not exist
This commit is contained in:
@@ -58,11 +58,11 @@ def process_sms_client_response(status, reference, client_name):
|
|||||||
# record stats
|
# record stats
|
||||||
notification = notifications_dao.update_notification_status_by_id(reference, notification_status)
|
notification = notifications_dao.update_notification_status_by_id(reference, notification_status)
|
||||||
if not notification:
|
if not notification:
|
||||||
status_error = "{} callback failed: notification {} either not found or already updated " \
|
current_app.logger.warning("{} callback failed: notification {} either not found or already updated "
|
||||||
"from sending. Status {}".format(client_name,
|
"from sending. Status {}".format(client_name,
|
||||||
reference,
|
reference,
|
||||||
notification_status_message)
|
notification_status_message))
|
||||||
return success, status_error
|
return success, errors
|
||||||
|
|
||||||
if not notification_success:
|
if not notification_success:
|
||||||
current_app.logger.info(
|
current_app.logger.info(
|
||||||
|
|||||||
@@ -149,10 +149,7 @@ def process_firetext_response():
|
|||||||
if errors:
|
if errors:
|
||||||
raise InvalidRequest(errors, status_code=400)
|
raise InvalidRequest(errors, status_code=400)
|
||||||
|
|
||||||
response_code = request.form.get('code')
|
|
||||||
status = request.form.get('status')
|
status = request.form.get('status')
|
||||||
current_app.logger.info('Firetext status: {}, extended error code: {}'.format(status, response_code))
|
|
||||||
|
|
||||||
success, errors = process_sms_client_response(status=status,
|
success, errors = process_sms_client_response(status=status,
|
||||||
reference=request.form.get('reference'),
|
reference=request.form.get('reference'),
|
||||||
client_name=client_name)
|
client_name=client_name)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user