mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 10:03:38 -04:00
Merge branch 'celery-send-sms-code' into celery-send-email-code
Conflicts: app/celery/tasks.py app/user/rest.py scripts/run_celery.sh
This commit is contained in:
@@ -34,12 +34,10 @@ def send_sms(service_id, notification_id, encrypted_notification):
|
|||||||
|
|
||||||
|
|
||||||
@notify_celery.task(name='send-sms-code')
|
@notify_celery.task(name='send-sms-code')
|
||||||
def send_sms_code(encrypted_notification):
|
def send_sms_code(encrypted_verification):
|
||||||
notification = encryption.decrypt(encrypted_notification)
|
verification_message = encryption.decrypt(encrypted_verification)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = firetext_client.send_sms(notification['to'], notification['secret_code'])
|
firetext_client.send_sms(verification_message['to'], verification_message['secret_code'])
|
||||||
current_app.logger.info(response)
|
|
||||||
except FiretextClientException as e:
|
except FiretextClientException as e:
|
||||||
current_app.logger.error(e)
|
current_app.logger.error(e)
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
source environment.sh
|
source environment.sh
|
||||||
celery -A run_celery.notify_celery worker --loglevel=INFO --logfile=/var/log/notify/application.log --concurrency=4 -Q sms,sms_code,email_code
|
celery -A run_celery.notify_celery worker --loglevel=INFO --logfile=/var/log/notify/application.log --concurrency=4 -Q sms,sms-code,email-code
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ def test_should_send_sms_code(mocker):
|
|||||||
firetext_client.send_sms.assert_called_once_with(notification['to'], notification['secret_code'])
|
firetext_client.send_sms.assert_called_once_with(notification['to'], notification['secret_code'])
|
||||||
|
|
||||||
|
|
||||||
def test_should_log_firetext_client_exception(mocker):
|
def test_should_throw_firetext_client_exception(mocker):
|
||||||
notification = {'to': '+441234123123',
|
notification = {'to': '+441234123123',
|
||||||
'secret_code': '12345'}
|
'secret_code': '12345'}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user