]> git.ozlabs.org Git - patchwork/commitdiff
views: fix patch_to_mbox() for postscript
authorAndreas Bießmann <andreas@biessmann.de>
Tue, 19 Nov 2013 14:44:02 +0000 (15:44 +0100)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 24 Jul 2014 09:14:21 +0000 (17:14 +0800)
Before we changed the comment 'some comment\n---\n some/file | 1 +'
to 'some comment\n\n---\nsome/file | 1 +\n'. Now we pass this comment
unchanged.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/views/__init__.py

index 9d1d144fcb7b30e555a870fa80230d9d507b39d6..dfca56dd690c990fbd004f38810877a842197253 100644 (file)
@@ -181,7 +181,7 @@ def patch_to_mbox(patch):
     if len(parts) == 2:
         (body, postscript) = parts
         body = body.strip() + "\n"
-        postscript = postscript.strip() + "\n"
+        postscript = postscript.rstrip()
     else:
         postscript = ''
 
@@ -189,11 +189,8 @@ def patch_to_mbox(patch):
             .exclude(msgid = patch.msgid):
         body += comment.patch_responses()
 
-    if body:
-        body += '\n'
-
     if postscript:
-        body += '---\n' + postscript.strip() + '\n'
+        body += '---\n' + postscript + '\n'
 
     if patch.content:
         body += '\n' + patch.content