[users management view] return None if no entity related, not an empty tuple. Closes #2089085
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 15 Nov 2011 22:22:18 +0100
changeset 8083 3db2f3317d15
parent 8082 1c37783ff610
child 8084 e22c17e1710d
[users management view] return None if no entity related, not an empty tuple. Closes #2089085
web/views/cwuser.py
--- a/web/views/cwuser.py	Mon Nov 14 12:13:48 2011 +0100
+++ b/web/views/cwuser.py	Tue Nov 15 22:22:18 2011 +0100
@@ -221,7 +221,7 @@
         'in_group': tableview.EntityTableColRenderer(
             renderfunc=lambda w,x: x.view('reledit', rtype='in_group', role='subject', w=w)),
         'primary_email': tableview.RelatedEntityColRenderer(
-            getrelated=lambda x:x.primary_email and x.primary_email[0]),
+            getrelated=lambda x:x.primary_email and x.primary_email[0] or None),
         'cw_source': tableview.RelatedEntityColRenderer(
             getrelated=lambda x: x.cw_source[0]),
         }