mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-13 16:52:23 -05: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')
|
||||
def send_sms_code(encrypted_notification):
|
||||
notification = encryption.decrypt(encrypted_notification)
|
||||
|
||||
def send_sms_code(encrypted_verification):
|
||||
verification_message = encryption.decrypt(encrypted_verification)
|
||||
try:
|
||||
response = firetext_client.send_sms(notification['to'], notification['secret_code'])
|
||||
current_app.logger.info(response)
|
||||
firetext_client.send_sms(verification_message['to'], verification_message['secret_code'])
|
||||
except FiretextClientException as e:
|
||||
current_app.logger.error(e)
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
set -e
|
||||
|
||||
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'])
|
||||
|
||||
|
||||
def test_should_log_firetext_client_exception(mocker):
|
||||
def test_should_throw_firetext_client_exception(mocker):
|
||||
notification = {'to': '+441234123123',
|
||||
'secret_code': '12345'}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user