From patchwork Sat Nov 28 12:14:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 549638 X-Patchwork-Delegate: stephen.finucane@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1DDB3140291 for ; Sat, 28 Nov 2015 23:15:49 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 01B741A0600 for ; Sat, 28 Nov 2015 23:15:49 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id E0E8F1A0464 for ; Sat, 28 Nov 2015 23:15:08 +1100 (AEDT) Received: from [179.182.162.78] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1a2ePB-0005Cu-Mv; Sat, 28 Nov 2015 12:15:06 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.86) (envelope-from ) id 1a2eOx-0001AQ-0L; Sat, 28 Nov 2015 10:14:51 -0200 From: Mauro Carvalho Chehab To: Subject: [PATCH 08/10] views: make X-Patchwork-Delegate: to work again Date: Sat, 28 Nov 2015 10:14:44 -0200 Message-Id: <1448712886-3221-9-git-send-email-mchehab@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1448712886-3221-1-git-send-email-mchehab@osg.samsung.com> References: <1448712886-3221-1-git-send-email-mchehab@osg.samsung.com> X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Patchwork ML , Mauro Carvalho Chehab MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Something broke the output of X-Patchwork-Delegate: via xmlrpc. Fix it by moving the code to the xmlrpc part. Signed-off-by: Mauro Carvalho Chehab Acked-by: Stephen Finucane --- patchwork/models.py | 2 -- patchwork/views/__init__.py | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/patchwork/models.py b/patchwork/models.py index 024ff4d8d5e1..676422d8aae5 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -363,8 +363,6 @@ class Patch(models.Model): time.mktime(self.date.utctimetuple())) mail['From'] = unicode(self.submitter) mail['X-Patchwork-Id'] = str(self.id) - if self.delegate: - mail['X-Patchwork-Delegate'] = str(self.delegate.email) mail['Message-Id'] = self.msgid mail.set_unixfrom('From patchwork ' + self.date.ctime()) diff --git a/patchwork/views/__init__.py b/patchwork/views/__init__.py index 8df8920ce991..20122b733c3c 100644 --- a/patchwork/views/__init__.py +++ b/patchwork/views/__init__.py @@ -205,6 +205,10 @@ def patch_to_mbox(patch): mail['Message-Id'] = patch.msgid mail.set_unixfrom('From patchwork ' + patch.date.ctime()) + try: + mail['X-Patchwork-Delegate'] = str(patch.delegate.email) + except: + pass copied_headers = ['To', 'Cc', 'Date'] orig_headers = HeaderParser().parsestr(str(patch.headers))