projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af29bf7
)
[IMP] tools: mail: added a protection in a string.find, could have a None argument
author
Thibault Delavallée
<tde@openerp.com>
Tue, 22 Oct 2013 14:29:08 +0000
(16:29 +0200)
committer
Thibault Delavallée
<tde@openerp.com>
Tue, 22 Oct 2013 14:29:08 +0000
(16:29 +0200)
bzr revid: tde@openerp.com-
20131022142908
-sol44xaprx1b0b0a
openerp/tools/mail.py
patch
|
blob
|
history
diff --git
a/openerp/tools/mail.py
b/openerp/tools/mail.py
index
2e84f0b
..
6ab7119
100644
(file)
--- a/
openerp/tools/mail.py
+++ b/
openerp/tools/mail.py
@@
-195,7
+195,10
@@
def html_email_clean(html, remove=False, shorten=False, max_length=300):
cur_char_nbr += len(word)
if cur_char_nbr >= position:
break
- stop_idx = node.text.find(word) + len(word)
+ if word:
+ stop_idx = node.text.find(word) + len(word)
+ else:
+ stop_idx = len(node.text)
if stop_idx == -1:
stop_idx = len(node.text)
else: