summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f73c3f)
raw | patch | inline | side by side (parent: 9f73c3f)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 29 May 2011 18:25:49 +0000 (18:25 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 29 May 2011 18:25:49 +0000 (18:25 +0000) |
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.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4609 57a73879-2fb5-44c3-a270-3262357dd7e2
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.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4609 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
doc/acknowledgements.txt | patch | blob | history | |
roundup/mailgw.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 12d17c4df0a1e8741fad67cbedf48ac1a432031b..72a1765975ec4254b7a54ee17065747babeb18e7 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
are given with the most recent entry first. If no other name is given,
Richard Jones did the change.
are given with the most recent entry first. If no other name is given,
Richard Jones did the change.
-2011-XX-XX 1.X.XX (rXXXX)
+2011-05-29 1.4.18 (rXXXX)
Features:
- Norwegian Bokmal translation by Christian Aastorp
- Allow to specify additional cc and bcc emails (not roundup users) for
Features:
- Norwegian Bokmal translation by Christian Aastorp
- Allow to specify additional cc and bcc emails (not roundup users) for
- nosymessage used by the nosyreaction reactor.
+ nosymessage used by the nosyreaction reactor. (Ralf)
+
+Fixed:
+
+- 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.
2011-05-13 1.4.17 (r4605)
2011-05-13 1.4.17 (r4605)
index 49090a8f308fe30b7e0b571c0377c52d2f064960..2a3542f45e2b2bf86b075bc4cb55d01af7d5e697 100644 (file)
--- a/doc/acknowledgements.txt
+++ b/doc/acknowledgements.txt
Marlon van den Berg,
Bo Berglund,
Stéphane Bidoul,
Marlon van den Berg,
Bo Berglund,
Stéphane Bidoul,
+Rafal Bisingier,
Cameron Blackwood,
Jeff Blaine,
Duncan Booth,
Cameron Blackwood,
Jeff Blaine,
Duncan Booth,
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 1664484c12081791864a7cf05eea35c6e9eb6118..23373ed32ccef3099bace009ddf9676c24a933a4 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
fileprop.extend(files)
files = fileprop
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
def create_msg(self):
''' Create msg containing all the relevant information from the message
try:
message_id = self.db.msg.create(author=self.author,
recipients=self.recipients, date=date.Date('.'),
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, _("""
messageid=messageid, inreplyto=inreplyto, **msg_props)
except exceptions.Reject, error:
raise MailUsageError, _("""
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index 69c5e07b93a204d2929e6579f323d62dc3b5622a..c85dff0f8edcb5068c508f6313ebef0fe68e8893 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
self.assertEqual(f.content, content [n])
self.assertEqual(msg.content, 'test attachment second text/plain')
self.assertEqual(f.content, content [n])
self.assertEqual(msg.content, 'test attachment second text/plain')
+ def testMultipartKeepFiles(self):
+ self.doNewIssue()
+ self._handle_mail(self.multipart_msg)
+ messages = self.db.issue.get('1', 'messages')
+ messages.sort()
+ msg = self.db.msg.getnode (messages[-1])
+ assert(len(msg.files) == 5)
+ issue = self.db.issue.getnode ('1')
+ assert(len(issue.files) == 5)
+ names = {0 : 'first.dvi', 4 : 'second.dvi'}
+ content = {3 : 'test attachment third text/plain\n',
+ 4 : 'Just a test\n'}
+ for n, id in enumerate (msg.files):
+ f = self.db.file.getnode (id)
+ self.assertEqual(f.name, names.get (n, 'unnamed'))
+ if n in content :
+ self.assertEqual(f.content, content [n])
+ self.assertEqual(msg.content, 'test attachment second text/plain')
+ self._handle_mail('''From: mary <mary@test.test>
+To: issue_tracker@your.tracker.email.domain.example
+Message-Id: <followup_dummy_id2>
+In-Reply-To: <dummy_test_message_id>
+Subject: [issue1] Testing...
+
+This ist a message without attachment
+''')
+ issue = self.db.issue.getnode ('1')
+ assert(len(issue.files) == 5)
+ self.assertEqual(issue.files, ['1', '2', '3', '4', '5'])
+
def testMultipartDropAlternatives(self):
self.doNewIssue()
self.db.config.MAILGW_IGNORE_ALTERNATIVES = True
def testMultipartDropAlternatives(self):
self.doNewIssue()
self.db.config.MAILGW_IGNORE_ALTERNATIVES = True