[views] fix some crashers (schema still does not render properly, might be yams side)
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 16 Jul 2009 17:00:55 +0200
changeset 2387 ea1defea9636
parent 2386 b246d5cee44e
child 2389 c399bd6a9c38
child 2541 09615ea7533e
[views] fix some crashers (schema still does not render properly, might be yams side)
web/views/schema.py
web/views/startup.py
--- a/web/views/schema.py	Thu Jul 16 17:00:19 2009 +0200
+++ b/web/views/schema.py	Thu Jul 16 17:00:55 2009 +0200
@@ -27,7 +27,7 @@
 
 def skip_types(req):
     if int(req.form.get('skipmeta', True)):
-        return schema.SKIP_TYPES
+        return SKIP_TYPES
     return ()
 
 class ViewSchemaAction(action.Action):
@@ -191,15 +191,15 @@
 
 class RestrictedSchemaVisitorMixIn(object):
     def __init__(self, req, *args, **kwargs):
+        self.req = req
         super(RestrictedSchemaVisitorMixIn, self).__init__(*args, **kwargs)
-        self.req = req
 
-    def should_display_schema(self, schema):
-        return (super(RestrictedSchemaVisitorMixIn, self).should_display_schema(schema)
+    def should_display_schema(self, rschema):
+        return (super(RestrictedSchemaVisitorMixIn, self).should_display_schema(rschema)
                 and rschema.has_local_role('read') or rschema.has_perm(self.req, 'read'))
 
-    def should_display_attr(self, schema):
-        return (super(RestrictedSchemaVisitorMixIn, self).should_display_attr(schema)
+    def should_display_attr(self, rschema):
+        return (super(RestrictedSchemaVisitorMixIn, self).should_display_attr(rschema)
                 and rschema.has_local_role('read') or rschema.has_perm(self.req, 'read'))
 
 
--- a/web/views/startup.py	Thu Jul 16 17:00:19 2009 +0200
+++ b/web/views/startup.py	Thu Jul 16 17:00:55 2009 +0200
@@ -10,7 +10,7 @@
 _ = unicode
 
 from logilab.common.textutils import unormalize
-from logilab.mtconverter import html_escape
+from logilab.mtconverter import xml_escape
 
 from cubicweb.view import StartupView
 from cubicweb.selectors import match_user_groups, implements