[ibreadcrumb] fix breadcrumb adapter backward compat stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 28 Jan 2011 16:19:22 +0100
branchstable
changeset 6920 c41336a682ed
parent 6919 8fd6921f3e7c
child 6921 c1fdf590712f
[ibreadcrumb] fix breadcrumb adapter backward compat
web/views/ibreadcrumbs.py
--- a/web/views/ibreadcrumbs.py	Fri Jan 28 16:08:40 2011 +0100
+++ b/web/views/ibreadcrumbs.py	Fri Jan 28 16:19:22 2011 +0100
@@ -52,7 +52,7 @@
     __select__ = is_instance('Any', accept_none=False)
 
     def parent_entity(self):
-        if hasattr(self.entity, 'parent'):
+        if hasattr(self.entity, 'parent') and callable(self.entity.parent):
             warn('[3.9] parent() method is deprecated, define a '
                  'custom IBreadCrumbsAdapter/ITreeAdapter for %s instead'
                  % self.entity.__class__, DeprecationWarning)