diff roundup/cgi/templating.py @ 4879:302c967d710c

HTML* classes for cgi: handle MissingValue case
author Ralf Schlatterbeck <rsc@runtux.com>
date Sat, 29 Mar 2014 11:59:37 +0100
parents f6e76a03b502
children ca692423e401
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Sat Mar 29 10:52:20 2014 +0100
+++ b/roundup/cgi/templating.py	Sat Mar 29 11:59:37 2014 +0100
@@ -1938,6 +1938,9 @@
            due to __getattr__ returning the __getitem__ of HTMLItem -- this
            lookup doesn't work for new-style classes.
         """
+        if not self._value:
+            msg = self._('Attempt to look up %(item)s on a missing value')
+            return MissingValue(msg%locals())
         i = HTMLItem(self._client, self._prop.classname, self._value)
         return i[item]
 

Roundup Issue Tracker: http://roundup-tracker.org/