Author: eallen
Date: 2008-10-31 12:57:11 -0400 (Fri, 31 Oct 2008)
New Revision: 2717
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
A few if:s to avoid exceptions
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-31 16:56:15 UTC (rev 2716)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-31 16:57:11 UTC (rev 2717)
@@ -493,22 +493,26 @@
def render_title(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return cls.get_object_title(session, object)
+ if cls:
+ return cls.get_object_title(session, object)
def render_icon_href(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return cls.get_icon_href(session)
+ if cls:
+ return cls.get_icon_href(session)
class SummaryProperties(CuminProperties):
def do_get_items(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return [(x.get_title(session), x.value(session, object), x.escape)
+ if cls:
+ return [(x.get_title(session), x.value(session, object), x.escape)
for x in cls.properties if x.summary]
class SummaryActions(CuminActions):
def do_get_items(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return [(x.get_href(session, object), x.get_title(session),
x.get_enabled(session, object))
+ if cls:
+ return [(x.get_href(session, object), x.get_title(session),
x.get_enabled(session, object))
for x in cls.actions if x.summary and x.navigable]
class StateSwitch(ItemSet):
Show replies by date