mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05: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:
@@ -68,12 +68,14 @@ def post_notification(notification_type):
|
||||
|
||||
if not simulated:
|
||||
tasks.send_notification_to_persist_queue(
|
||||
notification.id,
|
||||
service,
|
||||
template.template_type,
|
||||
encrypted,
|
||||
template.process_type == PRIORITY,
|
||||
service.research_mode or api_user.key_type == KEY_TYPE_TEST
|
||||
notification_id=notification.id,
|
||||
service=service,
|
||||
template_type=template.template_type,
|
||||
encrypted=encrypted,
|
||||
api_key_id=str(notification.api_key_id),
|
||||
key_type=api_user.key_type,
|
||||
priority=template.process_type == PRIORITY,
|
||||
research_mode=service.research_mode or api_user.key_type == KEY_TYPE_TEST
|
||||
)
|
||||
# not doing this during paas migration
|
||||
# queue_name = 'notify' if template.process_type == PRIORITY else None
|
||||
|
||||
Reference in New Issue
Block a user