fix test (this view is not used actually...)
authorsylvain.thenault@logilab.fr
Wed, 11 Feb 2009 10:43:02 +0100
changeset 570 0c9dfc430200
parent 569 94e2202ee9c3
child 571 e02c95dd1827
child 574 a6308ea5fb15
fix test (this view is not used actually...)
web/views/baseviews.py
--- a/web/views/baseviews.py	Wed Feb 11 10:41:16 2009 +0100
+++ b/web/views/baseviews.py	Wed Feb 11 10:43:02 2009 +0100
@@ -862,13 +862,8 @@
         assert rtype is not None, "rtype is mandatory for 'edirelation' view"
         targettype = self.req.form.get('targettype', targettype)
         role = self.req.form.get('role', role)
-        mode = entity.rtags.get_mode(rtype, targettype, role)
-        if mode == 'create':
-            return
         category = entity.rtags.get_category(rtype, targettype, role)
-        if category in ('generated', 'metadata'):
-            return
-        elif category in ('primary', 'secondary'):
+        if category in ('primary', 'secondary') or self.schema.rschema(rtype).is_final():
             if hasattr(entity, '%s_format' % rtype):
                 formatwdg = entity.get_widget('%s_format' % rtype, role)
                 self.w(formatwdg.edit_render(entity))
@@ -879,10 +874,8 @@
             self.w(u'%s %s %s' %
                    (wdg.render_error(entity), wdg.edit_render(entity),
                     wdg.render_help(entity),))
-        elif category == 'generic':
+        else:
             self._render_generic_relation(entity, rtype, role)
-        else:
-            self.error("oops, wrong category %s", category)
 
     def _render_generic_relation(self, entity, relname, role):
         text = self.req.__('add %s %s %s' % (entity.e_schema, relname, role))