on inline form validation, also provide the 'unspecified' placeholder value for empty fields tls-sprint
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 13 May 2009 16:07:44 +0200
branchtls-sprint
changeset 1795 abffc24f93c5
parent 1794 e735cb4650c6
child 1796 2cb2c96c82d9
on inline form validation, also provide the 'unspecified' placeholder value for empty fields
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Wed May 13 15:55:47 2009 +0200
+++ b/web/views/basecontrollers.py	Wed May 13 16:07:44 2009 +0200
@@ -399,7 +399,8 @@
             rset = self.req.execute('Any X,N WHERE X eid %%(x)s, X %s N' % rtype,
                                     {'x': eid}, 'x')
             entity = rset.get_entity(0, 0)
-            return (success, args, entity.printable_value(rtype))
+            value = entity.printable_value(rtype)
+            return (success, args, value or self.req._('not specified'))
         else:
             return (success, args, None)