mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 17:38:50 -04:00
Mutate dictionary instead of creating new one
Stops the case where keyword arguments could conflict.
This commit is contained in:
@@ -115,16 +115,9 @@ def get_all_personalisation_from_notification(notification):
|
||||
notification['personalisation'] = {}
|
||||
|
||||
if notification['template']['template_type'] == 'email':
|
||||
return dict(
|
||||
email_address=notification['to'],
|
||||
**notification['personalisation']
|
||||
)
|
||||
notification['personalisation']['email_address'] = notification['to']
|
||||
|
||||
if notification['template']['template_type'] == 'sms':
|
||||
return dict(
|
||||
phone_number=notification['to'],
|
||||
**notification['personalisation']
|
||||
)
|
||||
notification['personalisation']['phone_number'] = notification['to']
|
||||
|
||||
if notification['template']['template_type'] == 'letter':
|
||||
return notification['personalisation']
|
||||
return notification['personalisation']
|
||||
|
||||
Reference in New Issue
Block a user