web/views/baseviews.py
changeset 570 0c9dfc430200
parent 532 ce3e94cbb074
child 573 9c8fd72ba6c1
--- 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))