override clear_all_caches to clear cwetype_workflow cache 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 Aug 2009 08:45:16 +0200
branch3.5
changeset 2948 d3cd8bd20ee5
parent 2947 083593802120
child 2949 a2aa2c51f3be
override clear_all_caches to clear cwetype_workflow cache
entities/wfobjs.py
--- a/entities/wfobjs.py	Fri Aug 21 08:44:51 2009 +0200
+++ b/entities/wfobjs.py	Fri Aug 21 08:45:16 2009 +0200
@@ -9,7 +9,7 @@
 
 from warnings import warn
 
-from logilab.common.decorators import cached
+from logilab.common.decorators import cached, clear_cache
 from logilab.common.deprecation import deprecated
 
 from cubicweb.entities import AnyEntity, fetch_config
@@ -370,6 +370,11 @@
                                ('wf_info_for', 'E'), S=state.eid, E=self.eid,
                                **self._get_tr_kwargs(comment, commentformat))
 
+
+    def clear_all_caches(self):
+        super(WorkflowableMixIn, self).clear_all_caches()
+        clear_cache(self, 'cwetype_workflow')
+
     @deprecated('get transition from current workflow and use its may_be_fired method')
     def can_pass_transition(self, trname):
         """return the Transition instance if the current user can fire the