From fa46c9904a7d59bb38db7d505a65e492202f480d Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Wed, 6 Jan 2016 10:11:01 +0500 Subject: [PATCH] [FIX] email_from parsing. There was an error with specific email_from value (e.g. '"name @ example" ') --- __openerp__.py | 2 +- doc/changelog.rst | 5 +++++ mail_move_message_models.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/__openerp__.py b/__openerp__.py index d0be422..e127d46 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -1,6 +1,6 @@ { 'name' : 'Mail relocation', - 'version' : '1.0.2', + 'version' : '1.0.3', 'author' : 'IT-Projects LLC, Ivan Yelizariev', 'license': 'GPL-3', 'category' : 'Social Network', diff --git a/doc/changelog.rst b/doc/changelog.rst index 0f71071..5bd67a7 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -3,6 +3,11 @@ Changelog ========= +`1.0.3` +------- + +- FIX email_from parsing. There was an error with specific email_from value (e.g. '"name @ example" ') + `1.0.2` ------- diff --git a/mail_move_message_models.py b/mail_move_message_models.py index 3f123e6..838ebff 100644 --- a/mail_move_message_models.py +++ b/mail_move_message_models.py @@ -37,7 +37,7 @@ class wizard(models.TransientModel): parts = email_split(email_from.replace(' ',',')) if parts: email = parts[0] - name = email_from[:email_from.index(email)].replace('"', '').replace('<', '').strip() or email_from + name = email_from.find(email) != -1 and email_from[:email_from.index(email)].replace('"', '').replace('<', '').strip() or email_from else: name, email = email_from res['message_name_from'] = name