use ._cw instead of req on appobject classes
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Sep 2009 10:22:04 +0200
changeset 3401 f893f4f199fc
parent 3400 93fc0070673a
child 3402 434946bb5356
use ._cw instead of req on appobject classes
schema.py
--- a/schema.py	Wed Sep 23 10:21:37 2009 +0200
+++ b/schema.py	Wed Sep 23 10:22:04 2009 +0200
@@ -959,12 +959,12 @@
 
 @monkeypatch(FormatConstraint)
 def vocabulary(self, entity=None, form=None):
-    req = None
+    cw = None
     if form is None and entity is not None:
-        req = entity.req
+        cw = entity._cw
     elif form is not None:
-        req = form.req
-    if req is not None and req.user.has_permission(PERM_USE_TEMPLATE_FORMAT):
+        cw = form._cw
+    if cw is not None and cw.user.has_permission(PERM_USE_TEMPLATE_FORMAT):
         return self.regular_formats + tuple(NEED_PERM_FORMATS)
     return self.regular_formats