From: Andreas Bießmann Date: Tue, 19 Nov 2013 14:44:02 +0000 (+0100) Subject: views: fix patch_to_mbox() for postscript X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=0a502d0cf5b0daced5869130b1003d2002d547ab;p=patchwork views: fix patch_to_mbox() for postscript 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 Signed-off-by: Jeremy Kerr --- diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py index 9d1d144..dfca56d 100644 --- a/apps/patchwork/views/__init__.py +++ b/apps/patchwork/views/__init__.py @@ -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