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:
Rebecca Law
2017-01-27 14:02:56 +00:00
committed by GitHub
3 changed files with 580 additions and 634 deletions

View File

@@ -58,11 +58,11 @@ def process_sms_client_response(status, reference, client_name):
# record stats
notification = notifications_dao.update_notification_status_by_id(reference, notification_status)
if not notification:
status_error = "{} callback failed: notification {} either not found or already updated " \
"from sending. Status {}".format(client_name,
reference,
notification_status_message)
return success, status_error
current_app.logger.warning("{} callback failed: notification {} either not found or already updated "
"from sending. Status {}".format(client_name,
reference,
notification_status_message))
return success, errors
if not notification_success:
current_app.logger.info(

View File

@@ -149,10 +149,7 @@ def process_firetext_response():
if errors:
raise InvalidRequest(errors, status_code=400)
response_code = request.form.get('code')
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,
reference=request.form.get('reference'),
client_name=client_name)

File diff suppressed because it is too large Load Diff