diff mbox

[50/51] filters: Fix submitter display when we only have an email address

Message ID 1440440620-25937-51-git-send-email-damien.lespiau@intel.com
State Changes Requested
Headers show

Commit Message

Damien Lespiau Aug. 24, 2015, 6:23 p.m. UTC
I'm fairly sure I fixed that already, but here we go again. It's totally
valid to only have an email address for the submitter, so handle that
case properly.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 patchwork/templates/patchwork/filters.html | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Stephen Finucane Sept. 10, 2015, 4:38 p.m. UTC | #1
> I'm fairly sure I fixed that already, but here we go again. It's totally

> valid to only have an email address for the submitter, so handle that

> case properly.

> 

> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>


Acked but please combine this with the patch that introduced the original change - no point fixing the bug retroactively when we can do it now.

Acked-by: Stephen Finucane <stephen.finucane@intel.com>
diff mbox

Patch

diff --git a/patchwork/templates/patchwork/filters.html b/patchwork/templates/patchwork/filters.html
index fe0c9b8..65fd6bf 100644
--- a/patchwork/templates/patchwork/filters.html
+++ b/patchwork/templates/patchwork/filters.html
@@ -54,11 +54,15 @@  $(document).ready(function() {
         },
         render: {
             option: function(item, escape) {
-                return '<div>' + escape(item.name) + ' &lt;' +
-                                 escape(item.email) + '&gt;' + '</div>';
+                if (item.name)
+                    return '<div>' + escape(item.name) + ' &lt;' +
+                                     escape(item.email) + '&gt;' + '</div>';
+                return '<div>' + escape(item.email) + '</div>';
             },
             item: function(item, escape) {
-                return '<div>' + escape(item.name) + '</div>';
+                if (item.name)
+                    return '<div>' + escape(item.name) + '</div>';
+                return '<div>' + escape(item.email) + '</div>';
             }
         },
         load: function(query, callback) {