cubicweb/cwvreg.py
branch3.26
changeset 12497 c81e29cd8cff
parent 11900 8496135b6dc1
child 12511 e312461d3200
--- a/cubicweb/cwvreg.py	Wed Mar 13 14:01:10 2019 +0100
+++ b/cubicweb/cwvreg.py	Thu Mar 14 09:38:20 2019 +0100
@@ -250,6 +250,15 @@
                       key=lambda x: x.order)
 
     def possible_actions(self, req, rset=None, **kwargs):
+        if not kwargs:
+            raise ValueError("ActionsRegistry.possible_actions should always be "
+                             "called with additional keywords arguments (in "
+                             "addition of req and the optional argument rset) "
+                             "to optimised cache computation but you provided "
+                             "none.\n\nFor exemple if you are working on a view, "
+                             "provide the view as a keyword argument to "
+                             "possible_actions like this: view=my_view.")
+
         if rset is None:
             actions = self.poss_visible_objects(req, rset=rset, **kwargs)
         else: