diff mbox

[08/10] views: make X-Patchwork-Delegate: to work again

Message ID 1448712886-3221-9-git-send-email-mchehab@osg.samsung.com
State Rejected
Delegated to: Stephen Finucane
Headers show

Commit Message

Mauro Carvalho Chehab Nov. 28, 2015, 12:14 p.m. UTC
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 <mchehab@osg.samsung.com>
---
 patchwork/models.py         | 2 --
 patchwork/views/__init__.py | 4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Stephen Finucane Jan. 6, 2016, 5:20 p.m. UTC | #1
On 28 Nov 10:14, Mauro Carvalho Chehab wrote:
> 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 <mchehab@osg.samsung.com>

This is all that's needed :) (Well - some UTs also but that's a
different matter).

Acked-by: Stephen Finucane <stephen.finucane@intel.com>
Stephen Finucane Jan. 19, 2016, 9:27 p.m. UTC | #2
On 06 Jan 17:20, Finucane, Stephen wrote:
> On 28 Nov 10:14, Mauro Carvalho Chehab wrote:
> > 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 <mchehab@osg.samsung.com>
> 
> This is all that's needed :) (Well - some UTs also but that's a
> different matter).
> 
> Acked-by: Stephen Finucane <stephen.finucane@intel.com>

Dropped in favour of patch 11.
diff mbox

Patch

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))