[PATCH 02/19] ui: Don't display the '<' and '>' characters in the message-id

Stephen Finucane stephen.finucane at intel.com
Thu Feb 4 08:31:37 AEDT 2016


From: Damien Lespiau <damien.lespiau at intel.com>

Suggested-by: Jani Nikula <jani.nikula at intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
Acked-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/templates/patchwork/patch.html | 2 +-
 patchwork/templatetags/patch.py          | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/patchwork/templates/patchwork/patch.html b/patchwork/templates/patchwork/patch.html
index f379317..d73377f 100644
--- a/patchwork/templates/patchwork/patch.html
+++ b/patchwork/templates/patchwork/patch.html
@@ -43,7 +43,7 @@ function toggle_headers(link_id, headers_id)
 <table class="patchmeta">
  <tr>
   <th>Message ID</th>
-  <td>{{ patch.msgid }}</td>
+  <td>{{ patch.msgid|msgid }}</td>
  </tr>
   <tr>
    <th>State</th>
diff --git a/patchwork/templatetags/patch.py b/patchwork/templatetags/patch.py
index 90519e6..c65bd5e 100644
--- a/patchwork/templatetags/patch.py
+++ b/patchwork/templatetags/patch.py
@@ -22,6 +22,7 @@ from __future__ import absolute_import
 
 from django import template
 from django.utils.safestring import mark_safe
+from django.template.defaultfilters import stringfilter
 
 from patchwork.models import Check
 
@@ -59,3 +60,9 @@ def patch_checks(patch):
 @register.filter(name='state_class')
 def state_class(state):
     return '-'.join(state.split())
+
+
+ at register.filter
+ at stringfilter
+def msgid(value):
+    return mark_safe(value.strip('<>'))
-- 
2.0.0



More information about the Patchwork mailing list