Browse Source

[FIX] mail_tracking_mailgun: Message error on bounce

pull/268/head
Pedro M. Baeza 7 years ago
committed by David
parent
commit
5aa0e87e34
  1. 2
      mail_tracking_mailgun/__manifest__.py
  2. 3
      mail_tracking_mailgun/models/res_partner.py
  3. 2
      mail_tracking_mailgun/tests/test_mailgun.py

2
mail_tracking_mailgun/__manifest__.py

@ -7,7 +7,7 @@
{
"name": "Mail tracking for Mailgun",
"summary": "Mail tracking and Mailgun webhooks integration",
"version": "10.0.1.1.1",
"version": "10.0.1.1.2",
"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

@ -392,7 +392,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