web/views/editforms.py
changeset 3674 387d51af966d
parent 3629 559cad62c786
parent 3643 8513fd032d1f
child 3720 5376aaadd16b
--- a/web/views/editforms.py	Tue Oct 13 18:21:24 2009 +0200
+++ b/web/views/editforms.py	Thu Oct 15 10:31:54 2009 +0200
@@ -177,6 +177,7 @@
             form = self._build_form(
                 entity, rtype, role, default, onsubmit, reload)
             if not self.should_edit_attribute(entity, rschema, role, form):
+                self.w(entity.printable_value(rtype))
                 return
             value = entity.printable_value(rtype) or default
             self.attribute_form(lzone, value, form,
@@ -184,13 +185,15 @@
         else:
             if rvid is None:
                 rvid = self._compute_best_vid(entity.e_schema, rschema, role)
-            if not self.should_edit_relation(entity, rschema, role, rvid):
-                return
             rset = entity.related(rtype, role)
             if rset:
                 value = self._cw.view(rvid, rset)
             else:
                 value = default
+            if not self.should_edit_relation(entity, rschema, role, rvid):
+                if rset:
+                    self.w(value)
+                return
             onsubmit = ("return inlineValidateRelationForm('%(rtype)s', '%(role)s', '%(eid)s', "
                         "'%(divid)s', %(reload)s, '%(vid)s', '%(default)s', '%(lzone)s');")
             form = self._build_form(