mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 02:23:32 -04:00
Use service ID, not from token to build notification
This commit is contained in:
@@ -119,13 +119,13 @@ def send_notification(notification_type, service_id=None, expects_job=False):
|
|||||||
|
|
||||||
if notification_type is SMS_NOTIFICATION:
|
if notification_type is SMS_NOTIFICATION:
|
||||||
send_sms.apply_async((
|
send_sms.apply_async((
|
||||||
api_user['client'],
|
service_id,
|
||||||
notification_id,
|
notification_id,
|
||||||
encryption.encrypt(notification)),
|
encryption.encrypt(notification)),
|
||||||
queue='sms')
|
queue='sms')
|
||||||
else:
|
else:
|
||||||
send_email.apply_async((
|
send_email.apply_async((
|
||||||
api_user['client'],
|
service_id,
|
||||||
notification_id,
|
notification_id,
|
||||||
template.subject,
|
template.subject,
|
||||||
"{}@{}".format(service.email_from, current_app.config['NOTIFY_EMAIL_DOMAIN']),
|
"{}@{}".format(service.email_from, current_app.config['NOTIFY_EMAIL_DOMAIN']),
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ def test_should_allow_valid_sms_notification_for_job(notify_api, sample_job, moc
|
|||||||
|
|
||||||
notification_id = json.loads(response.data)['notification_id']
|
notification_id = json.loads(response.data)['notification_id']
|
||||||
app.celery.tasks.send_sms.apply_async.assert_called_once_with(
|
app.celery.tasks.send_sms.apply_async.assert_called_once_with(
|
||||||
(str(sample_job.template.service_id),
|
(str(sample_job.service_id),
|
||||||
notification_id,
|
notification_id,
|
||||||
"something_encrypted"),
|
"something_encrypted"),
|
||||||
queue="sms"
|
queue="sms"
|
||||||
|
|||||||
Reference in New Issue
Block a user