Merge lp://qastaging/~sylvain-calador/poweremail/errors-with-attachments into lp://qastaging/poweremail/trunk

Proposed by Sylvain Calador
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~sylvain-calador/poweremail/errors-with-attachments
Merge into: lp://qastaging/poweremail/trunk
Diff against target: 21 lines (+2/-2)
1 file modified
poweremail_core.py (+2/-2)
To merge this branch: bzr merge lp://qastaging/~sylvain-calador/poweremail/errors-with-attachments
Reviewer Review Type Date Requested Status
Sharoon Thomas http://openlabs.co.in Approve
Review via email: mp+16231@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Sylvain Calador (sylvain-calador) wrote :

Hi,

This branch fix 2 bugs when full download of email which contains attachments.

Best regards,

Sylvain

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

Sylvain,

You rock!!!!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'poweremail_core.py'
2--- poweremail_core.py 2009-12-14 09:25:55 +0000
3+++ poweremail_core.py 2009-12-16 09:03:13 +0000
4@@ -405,7 +405,7 @@
5 logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("Header for Mail %s Saved successfully as ID:%s for Account:%s.") % (serv_ref, crid, coreaccountid))
6 #If there are attachments save them as well
7 if parsed_mail['attachments']:
8- self.save_attachments(self, cr, uid, mail, crid, parsed_mail, coreaccountid)
9+ self.save_attachments(cr, uid, mail, crid, parsed_mail, coreaccountid)
10 crid = False
11 return True
12 else:
13@@ -463,7 +463,7 @@
14 for each in parsed_mail['attachments']:#Get each attachment
15 new_att_vals = {
16 'name':mail['subject'] + '(' + each[0] + ')',
17- 'datas':base64.b64encode(each[2]),
18+ 'datas':base64.b64encode(each[2] or ''),
19 'datas_fname':each[1],
20 'description':(mail['subject'] or 'No Subject') + " [Type:" + (each[0] or 'Unknown') + ", Filename:" + (each[1] or 'No Name') + "]",
21 'res_model':'poweremail.mailbox',