Patchwork [4/4] views: fix patch_to_mbox() for postscript

login
register
mail settings
Submitter Andreas Bießmann
Date Nov. 19, 2013, 2:44 p.m.
Message ID <1384872242-18238-4-git-send-email-andreas@biessmann.de>
Download mbox | patch
Permalink /patch/292586/
State Accepted
Headers show

Comments

Andreas Bießmann - Nov. 19, 2013, 2:44 p.m.
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>
---
 apps/patchwork/views/__init__.py |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Patch

diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py
index a823388..dd307e0 100644
--- a/apps/patchwork/views/__init__.py
+++ b/apps/patchwork/views/__init__.py
@@ -173,7 +173,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 = ''
 
@@ -181,11 +181,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