schema.py
changeset 3401 f893f4f199fc
parent 3369 7b88d12b4ee2
child 3471 8c57c71b859c
--- 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