[CMF-checkins] CVS: CMF/CMFCore - ActionProviderBase.py:1.23
Yvo Schubbe
schubbe at web.de
Mon Jan 5 12:29:50 EST 2004
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv6633/CMFCore
Modified Files:
ActionProviderBase.py
Log Message:
raise an error if no Action meets the given specification
=== CMF/CMFCore/ActionProviderBase.py 1.22 => 1.23 ===
--- CMF/CMFCore/ActionProviderBase.py:1.22 Fri Nov 28 09:52:00 2003
+++ CMF/CMFCore/ActionProviderBase.py Mon Jan 5 12:29:20 2004
@@ -119,7 +119,9 @@
action_infos = self.listActionInfos(action_chain, object,
check_visibility=check_visibility,
check_condition=check_condition, max=1)
- return action_infos and action_infos[0] or None
+ if not action_infos:
+ raise ValueError('No Action meets the given specification.')
+ return action_infos[0]
#
# ZMI methods
@@ -423,6 +425,8 @@
action_infos = self.listActionInfos(action_chain, object,
check_visibility=check_visibility,
check_condition=check_condition, max=1)
- return action_infos and action_infos[0] or None
+ if not action_infos:
+ raise ValueError('No Action meets the given specification.')
+ return action_infos[0]
InitializeClass(OldstyleActionProviderBase)
More information about the CMF-checkins
mailing list