summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e1f18a2)
raw | patch | inline | side by side (parent: e1f18a2)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 1 Jun 2011 12:49:47 +0000 (12:49 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 1 Jun 2011 12:49:47 +0000 (12:49 +0000) |
an issue, not just the new ones. Thanks to Rafal Bisingier for
reporting and proposing a fix. The regression test was updated.
Fix version numbers in upgrade documentation, the file-unlink defect
was in 1.4.17 not 1.4.16. Thanks to Rafal Bisingier.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4615 57a73879-2fb5-44c3-a270-3262357dd7e2
reporting and proposing a fix. The regression test was updated.
Fix version numbers in upgrade documentation, the file-unlink defect
was in 1.4.17 not 1.4.16. Thanks to Rafal Bisingier.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4615 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
doc/upgrading.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 497dd5b80b2e9aac3f577e2edad1aba4abf0c1c9..21be4c998e198eb5b98454febe9def55a4990abe 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.
+2011-XX-XX 1.4.19 (r46XX)
+
+Fixed:
+
+- Yet another fix to the mail gateway, messages got *all* files of
+ an issue, not just the new ones. Thanks to Rafal Bisingier for
+ reporting and proposing a fix. The regression test was updated.
+ (Ralf)
+- Fix version numbers in upgrade documentation, the file-unlink defect
+ was in 1.4.17 not 1.4.16. Thanks to Rafal Bisingier.
+
2011-05-29 1.4.18 (r4610)
Features:
-- Norwegian Bokmal translation by Christian Aastorp (Ralf)
+- Norwegian Bokmal translation by Christian Aastorp
- Allow to specify additional cc and bcc emails (not roundup users) for
nosymessage used by the nosyreaction reactor. (Ralf)
diff --git a/doc/upgrading.txt b/doc/upgrading.txt
index eb0a68c9a0d9ea601fbc93c6790a2c2935d8c168..b739cf3abe3e481091b189871c957410b5d86132 100644 (file)
--- a/doc/upgrading.txt
+++ b/doc/upgrading.txt
.. contents::
-Migrating from 1.4.16 to 1.4.17
+Migrating from 1.4.17 to 1.4.18
===============================
-There was a bug in 1.4.16 where files were unlinked from issues if a
+There was a bug in 1.4.17 where files were unlinked from issues if a
mail without attachment was received via the mail interface. The
following script will list likely issues being affected by the bug.
-The date in the script is the date of the 1.4.16 release. If you have
-installed 1.4.16 later than this date, you can change the date
+The date in the script is the date of the 1.4.17 release. If you have
+installed 1.4.17 later than this date, you can change the date
appropriately to your installation date. Run the script in the directory
of your tracker.
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 23373ed32ccef3099bace009ddf9676c24a933a4..b90c98865ef4bb90a929ebc3869670989ff82480 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
self.nodeid = None
self.author = None
self.recipients = None
+ self.msg_props = {}
self.props = None
self.content = None
self.attachments = None
'You are not permitted to add files to %(classname)s.'
) % self.__dict__
+ self.msg_props['files'] = files
if self.nodeid:
# extend the existing files list
fileprop = self.cl.get(self.nodeid, 'files')
if not self.properties.has_key('messages'):
return
msg_props = self.mailgw.get_class_arguments('msg')
+ self.msg_props.update (msg_props)
# Get the message ids
inreplyto = self.message.getheader('in-reply-to') or ''
message_id = self.db.msg.create(author=self.author,
recipients=self.recipients, date=date.Date('.'),
summary=summary, content=content,
- files=self.props.get('files',[]),
- messageid=messageid, inreplyto=inreplyto, **msg_props)
+ messageid=messageid, inreplyto=inreplyto, **self.msg_props)
except exceptions.Reject, error:
raise MailUsageError, _("""
Mail message was rejected by a detector.
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index c85dff0f8edcb5068c508f6313ebef0fe68e8893..fa72040e6ae9658427e607e4b845e7beedffaf50 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')
+ def testMultipartSeveralAttachmentMessages(self):
+ self.doNewIssue()
+ self._handle_mail(self.multipart_msg)
+ messages = self.db.issue.get('1', 'messages')
+ messages.sort()
+ self.assertEqual(messages[-1], '2')
+ msg = self.db.msg.getnode (messages[-1])
+ self.assertEqual(len(msg.files), 5)
+ issue = self.db.issue.getnode ('1')
+ self.assertEqual(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.assertEqual(msg.files, ['1', '2', '3', '4', '5'])
+ self.assertEqual(issue.files, ['1', '2', '3', '4', '5'])
+
+ self._handle_mail(self.multipart_msg)
+ issue = self.db.issue.getnode ('1')
+ self.assertEqual(len(issue.files), 10)
+ messages = self.db.issue.get('1', 'messages')
+ messages.sort()
+ self.assertEqual(messages[-1], '3')
+ msg = self.db.msg.getnode (messages[-1])
+ self.assertEqual(issue.files, [str(i+1) for i in range(10)])
+ self.assertEqual(msg.files, ['6', '7', '8', '9', '10'])
+
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)
+ self.assertEqual(len(msg.files), 5)
issue = self.db.issue.getnode ('1')
- assert(len(issue.files) == 5)
+ self.assertEqual(len(issue.files), 5)
names = {0 : 'first.dvi', 4 : 'second.dvi'}
content = {3 : 'test attachment third text/plain\n',
4 : 'Just a test\n'}
This ist a message without attachment
''')
issue = self.db.issue.getnode ('1')
- assert(len(issue.files) == 5)
+ self.assertEqual(len(issue.files), 5)
self.assertEqual(issue.files, ['1', '2', '3', '4', '5'])
def testMultipartDropAlternatives(self):
messages = self.db.issue.get('1', 'messages')
messages.sort()
msg = self.db.msg.getnode (messages[-1])
- assert(len(msg.files) == 2)
+ self.assertEqual(len(msg.files), 2)
names = {1 : 'second.dvi'}
content = {0 : 'test attachment third text/plain\n',
1 : 'Just a test\n'}
messages = self.db.issue.get('1', 'messages')
messages.sort()
msg = self.db.msg.getnode (messages[-1])
- assert(len(msg.files) == 1)
+ self.assertEqual(len(msg.files), 1)
name = 'unnamed'
content = '<html>' + c + '</html>\n'
for n, id in enumerate (msg.files):
messages = self.db.issue.get('1', 'messages')
messages.sort()
msg = self.db.msg.getnode (messages[-1])
- assert(len(msg.files) == 1)
+ self.assertEqual(len(msg.files), 1)
name = 'unnamed'
content = '<html>' + c + '</html>\n'
for n, id in enumerate (msg.files):
messages = self.db.issue.get('1', 'messages')
messages.sort()
msg = self.db.msg.getnode (messages[-1])
- assert(len(msg.files) == 1)
+ self.assertEqual(len(msg.files), 1)
name = 'unnamed'
content = '<html>' + c + '</html>\n'
for n, id in enumerate (msg.files):
messages = self.db.issue.get('1', 'messages')
messages.sort()
msg = self.db.msg.getnode (messages[-1])
- assert(len(msg.files) == 1)
+ self.assertEqual(len(msg.files), 1)
name = 'unnamed'
content = '<html>' + c + '</html>\n'
for n, id in enumerate (msg.files):
messages = self.db.issue.get('1', 'messages')
messages.sort()
msg = self.db.msg.getnode (messages[-1])
- assert(len(msg.files) == 1)
+ self.assertEqual(len(msg.files), 1)
name = "Fwd: Original email subject.eml"
for n, id in enumerate (msg.files):
f = self.db.file.getnode (id)