mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
ensure we're passing through api keys and key types from notifications
when we made the change to async persist notifications, we forgot to pass through api_key_id and key_type. in send_sms/email, for legacy reasons, they default to None/KEY_TYPE_NORMAL, so regardless of what your api key was set up as, we would send real messages! TODO: Once the PaaS transition is complete and the task changes are reverted, remove the api_key_id and key_type params from the send_* tasks entirely, as those are only called from the csv job flow, and don't need them
This commit is contained in:
@@ -124,7 +124,14 @@ def process_row(row_number, recipient, personalisation, template, job, service):
|
||||
|
||||
|
||||
def send_notification_to_persist_queue(
|
||||
notification_id, service, template_type, encrypted, priority=False, research_mode=False
|
||||
notification_id,
|
||||
service,
|
||||
template_type,
|
||||
encrypted,
|
||||
api_key_id,
|
||||
key_type,
|
||||
priority=False,
|
||||
research_mode=False
|
||||
):
|
||||
queues = {
|
||||
SMS_TYPE: 'db-sms',
|
||||
@@ -150,8 +157,12 @@ def send_notification_to_persist_queue(
|
||||
str(service.id),
|
||||
notification_id,
|
||||
encrypted,
|
||||
datetime.utcnow().strftime(DATETIME_FORMAT)
|
||||
datetime.utcnow().strftime(DATETIME_FORMAT),
|
||||
),
|
||||
kwargs={
|
||||
'api_key_id': api_key_id,
|
||||
'key_type': key_type
|
||||
},
|
||||
queue=queue_name
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user