don't fail if there's no body at all
This commit is contained in:
parent
1fdb8783ce
commit
a3a89458a7
|
@ -73,13 +73,15 @@ def create_ticket(mail):
|
|||
|
||||
attachments = []
|
||||
|
||||
body = u''
|
||||
for data in mail.walk():
|
||||
attachment = parse_attachment(data)
|
||||
if attachment:
|
||||
attachments.append(attachment)
|
||||
elif data.get_content_type() == "text/plain":
|
||||
body = data.get_payload(decode=True)
|
||||
body = unicode(body, data.get_content_charset('utf-8')).encode('utf-8')
|
||||
new_body = data.get_payload(decode=True)
|
||||
if new_body:
|
||||
body = unicode(new_body, data.get_content_charset('utf-8')).encode('utf-8')
|
||||
|
||||
# get project tech manager
|
||||
tech_manager = None
|
||||
|
|
Loading…
Reference in New Issue