Browse Source

[FIX] mail_tracking_mailgun: Message error on bounce

pull/272/head
Pedro M. Baeza 7 years ago
committed by David
parent
commit
d20eda9942
  1. 2
      mail_tracking_mailgun/__openerp__.py
  2. 3
      mail_tracking_mailgun/models/res_partner.py
  3. 2
      mail_tracking_mailgun/tests/test_mailgun.py

2
mail_tracking_mailgun/__openerp__.py

@ -7,7 +7,7 @@
{
"name": "Mail tracking for Mailgun",
"summary": "Mail tracking and Mailgun webhooks integration",
"version": "9.0.1.2.0",
"version": "9.0.1.2.1",
"category": "Social Network",
"website": "https://odoo-community.org/",
"author": "Tecnativa, "

3
mail_tracking_mailgun/models/res_partner.py

@ -30,8 +30,7 @@ class ResPartner(models.Model):
body = _('Email has been bounced: %s\n'
'Reason: %s\n'
'Event: %s') % (partner.email, reason,
event and event.get('Message-Id',
_('unknown')))
event and event.id or _('unknown'))
partner.message_post(body=body)
@api.multi

2
mail_tracking_mailgun/tests/test_mailgun.py

@ -384,7 +384,7 @@ class TestMailgun(TransactionCase):
self.partner._email_bounced_set('test_error', self.event)
self.assertEqual(len(self.partner.message_ids), message_number)
self.partner.email = ""
self.partner._email_bounced_set('test_error', self.event)
self.partner._email_bounced_set('test_error')
self.assertEqual(len(self.partner.message_ids), message_number)
@mock.patch(_packagepath + '.models.mail_tracking_email.requests')

Loading…
Cancel
Save