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 <[email protected]>
---
 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))
-- 
2.5.0

_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to