Change names for clarity sake.

Rename test.
What we do when the validation_code fails to send is still to be decided.
This commit is contained in:
Rebecca Law
2016-02-18 09:59:18 +00:00
parent 66cf6cfd30
commit 3ce6758f3e
3 changed files with 8 additions and 8 deletions

View File

@@ -137,16 +137,16 @@ def send_user_code(user_id):
create_user_code(user, secret_code, verify_code.get('code_type'))
if verify_code.get('code_type') == 'sms':
mobile = user.mobile_number if verify_code.get('to', None) is None else verify_code.get('to')
notification = {'to': mobile, 'secret_code': secret_code}
send_sms_code.apply_async([encryption.encrypt(notification)], queue='sms_code')
verification_message = {'to': mobile, 'secret_code': secret_code}
send_sms_code.apply_async([encryption.encrypt(verification_message)], queue='sms_code')
elif verify_code.get('code_type') == 'email':
email = user.email_address if verify_code.get('to', None) is None else verify_code.get('to')
notification = {
verification_message = {
'to_address': email,
'from_address': current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'],
'subject': 'Verification code',
'body': secret_code}
add_notification_to_queue(api_user['client'], 'admin', 'email', notification)
add_notification_to_queue(api_user['client'], 'admin', 'email', verification_message)
else:
abort(500)
return jsonify({}), 204