notifications: do not HTML-escape patch change notifications

Submitted by Stefan Hajnoczi on Jan. 15, 2012, 7:49 p.m.

Details

Message ID 1326656964-24361-1-git-send-email-stefanha@linux.vnet.ibm.com
State Accepted
Commit 18986b7edf33b22e6bf3b4023dfcc12a0c78fb65
Headers show

Commit Message

Stefan Hajnoczi Jan. 15, 2012, 7:49 p.m.
Patch change notifications are text/plain emails and should not
HTML-escape patch names.  This means quotes and ampersands in patch
names should not be turned into " and & HTML entities.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
I spotted the following in the patch change notification I received:
'''
The following patch (submitted by you) has been updated in patchwork:

 * parser: allow words starting with &quot;diff&quot; at beginning of line
     - http://patchwork.ozlabs.org/patch/136093/
'''

Notice that "diff" is &quot;diff&quot; because of Django's automatic HTML
escaping.  I'm sending this patch to fix that - but I have not tested this
patch!

 templates/patchwork/patch-change-notification.mail |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/templates/patchwork/patch-change-notification.mail b/templates/patchwork/patch-change-notification.mail
index d86a6af..19a2a09 100644
--- a/templates/patchwork/patch-change-notification.mail
+++ b/templates/patchwork/patch-change-notification.mail
@@ -2,7 +2,7 @@  Hello,
 
 The following patch{{notifications|length|pluralize:"es"}} (submitted by you) {{notifications|length|pluralize:"has,have"}} been updated in patchwork:
 {% for notification in notifications %}
- * {{notification.patch.name}}
+ * {{notification.patch.name|safe}}
      - http://{{site.domain}}{{notification.patch.get_absolute_url}}
     was: {{notification.orig_state}}
     now: {{notification.patch.state}}