diff options
| author | Xavier Morel <xmo@odoo.com> | 2017-05-15 17:27:24 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2017-08-20 23:25:54 +0200 |
| commit | 481a00dc4b82bc1b2cbbd6079a147fe230ac57bd (patch) | |
| tree | 975b178f4e4a3733b904bd511d905160014ec009 /addons/mail/models/mail_thread.py | |
| parent | 9d83784f1df18306b6166fd92a0573f39bf6262d (diff) | |
[FIX] P3: hash/hmac payload must be bytes
Diffstat (limited to 'addons/mail/models/mail_thread.py')
| -rw-r--r-- | addons/mail/models/mail_thread.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index bc7b1d1072d..8dfe1ef452c 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -570,7 +570,7 @@ class MailThread(models.AbstractModel): def _generate_notification_token(self, base_link, params): secret = self.env['ir.config_parameter'].sudo().get_param('database.secret') token = '%s?%s' % (base_link, ' '.join('%s=%s' % (key, params[key]) for key in sorted(params))) - hm = hmac.new(str(secret), token, hashlib.sha1).hexdigest() + hm = hmac.new(secret.encode('utf-8'), token.encode('utf-8'), hashlib.sha1).hexdigest() return hm @api.multi |
