diff roundup/mailgw.py @ 4498:8df9492c2746

Fix file-unlink bug in mailgw (Ralfs oversight when refactoring the mail gateway code) -- if a message is sent that contains no attachments, all previous files of the issue are unlinked, thanks to Rafal Bisingier for reporting and proposing a fix. I've now added a regression test that catches this issue.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Sun, 29 May 2011 18:25:49 +0000
parents 693c75d56ebe
children 9f488541802f
line wrap: on
line diff
--- a/roundup/mailgw.py	Mon May 23 12:15:23 2011 +0000
+++ b/roundup/mailgw.py	Sun May 29 18:25:49 2011 +0000
@@ -1058,7 +1058,7 @@
                 fileprop.extend(files)
                 files = fileprop
 
-        self.props['files'] = files
+            self.props['files'] = files
 
     def create_msg(self):
         ''' Create msg containing all the relevant information from the message
@@ -1093,7 +1093,8 @@
             try:
                 message_id = self.db.msg.create(author=self.author,
                     recipients=self.recipients, date=date.Date('.'),
-                    summary=summary, content=content, files=self.props['files'],
+                    summary=summary, content=content,
+                    files=self.props.get('files',[]),
                     messageid=messageid, inreplyto=inreplyto, **msg_props)
             except exceptions.Reject, error:
                 raise MailUsageError, _("""

Roundup Issue Tracker: http://roundup-tracker.org/