mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Alpha client removed from code. Tests fixed but will wait till other notifications jobs are done before creating a pull request.
This commit is contained in:
@@ -133,15 +133,10 @@ def send_user_code(user_id):
|
||||
from app.dao.users_dao import create_secret_code
|
||||
secret_code = create_secret_code()
|
||||
create_user_code(user, secret_code, verify_code.get('code_type'))
|
||||
# TODO this will need to fixed up when we stop using
|
||||
# notify_alpha_client
|
||||
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, 'content': secret_code}
|
||||
add_notification_to_queue(api_user['client'], 'admin', 'sms', notification)
|
||||
notify_alpha_client.send_sms(
|
||||
mobile_number=mobile,
|
||||
message=secret_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 = {
|
||||
@@ -150,11 +145,6 @@ def send_user_code(user_id):
|
||||
'subject': 'Verification code',
|
||||
'body': secret_code}
|
||||
add_notification_to_queue(api_user['client'], 'admin', 'email', notification)
|
||||
notify_alpha_client.send_email(
|
||||
email,
|
||||
secret_code,
|
||||
notification['from_address'],
|
||||
notification['subject'])
|
||||
else:
|
||||
abort(500)
|
||||
return jsonify({}), 204
|
||||
|
||||
Reference in New Issue
Block a user