mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 18:07:33 -02:30
Fix an issue where smtplib can't handle unicode strings
We probably do get this value as unicode originally but when we store it, due to a recently fixed bug it will come out as *not* unicode. So things were accidentally working because py2 smtplib uses hmac which won't accept unicode. This change adds a flag to encrypt_field that forces it to skip the utf8 fixup from before for narrow use cases.
This commit is contained in:
@@ -75,7 +75,7 @@ class NotificationTemplate(CommonModel):
|
||||
setattr(self, '_saved_{}_{}'.format("config", field), value)
|
||||
self.notification_configuration[field] = ''
|
||||
else:
|
||||
encrypted = encrypt_field(self, 'notification_configuration', subfield=field)
|
||||
encrypted = encrypt_field(self, 'notification_configuration', subfield=field, skip_utf8=True)
|
||||
self.notification_configuration[field] = encrypted
|
||||
if 'notification_configuration' not in update_fields:
|
||||
update_fields.append('notification_configuration')
|
||||
|
||||
Reference in New Issue
Block a user