From 479a6a88c41203aca1a1f44253554a4f28d2e248 Mon Sep 17 00:00:00 2001 From: Guilherme Salgado Date: Mon, 28 Feb 2011 01:50:24 +0000 Subject: parser: Allow pull requests to include a diff If a patch comes along with a pull request and a diff, add both to the Patch model. Signed-off-by: Guilherme Salgado Signed-off-by: Jeremy Kerr --- apps/patchwork/bin/parsemail.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'apps/patchwork/bin') diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py index 2a4df38..c36dae4 100755 --- a/apps/patchwork/bin/parsemail.py +++ b/apps/patchwork/bin/parsemail.py @@ -185,15 +185,9 @@ def find_content(project, mail): patch = None comment = None - if patchbuf: - mail_headers(mail) + if pullurl or patchbuf: name = clean_subject(mail.get('Subject'), [project.linkname]) - patch = Patch(name = name, content = patchbuf, - date = mail_date(mail), headers = mail_headers(mail)) - - if pullurl: - name = clean_subject(mail.get('Subject'), [project.linkname]) - patch = Patch(name = name, pull_url = pullurl, + patch = Patch(name = name, pull_url = pullurl, content = patchbuf, date = mail_date(mail), headers = mail_headers(mail)) if commentbuf: -- cgit v1.2.3