[Erp5-report] r45049 leonardo - /erp5/trunk/products/ERP5/mixin/composition.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 4 15:28:09 CEST 2011
Author: leonardo
Date: Mon Apr 4 15:28:09 2011
New Revision: 45049
URL: http://svn.erp5.org?rev=45049&view=rev
Log:
Stop quickly _getOb uses of asComposedDocument() result
In predicate searches using asComposedDocument() result as context, categories where being looked up as subobjects, triggering the _folder_handler assertion.
Make sure it fails the lookup fast.
Modified:
erp5/trunk/products/ERP5/mixin/composition.py
Modified: erp5/trunk/products/ERP5/mixin/composition.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/mixin/composition.py?rev=45049&r1=45048&r2=45049&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/mixin/composition.py [utf8] (original)
+++ erp5/trunk/products/ERP5/mixin/composition.py [utf8] Mon Apr 4 15:28:09 2011
@@ -144,7 +144,10 @@ class asComposedDocument(object):
@property
def _folder_handler(self):
- assert False
+ assert False, "Attempt to use .asComposedDocument() result as folder. This should never happen!"
+
+ def _getOb(self, key, *args, **kw):
+ raise KeyError(key)
def __getattr__(self, name):
raise AttributeError(name)
More information about the Erp5-report
mailing list