web/views/baseforms.py
changeset 240 6ba006fb95d1
parent 237 3df2e0ae2eba
child 431 18b4dd650ef8
--- a/web/views/baseforms.py	Fri Dec 19 15:44:11 2008 +0100
+++ b/web/views/baseforms.py	Fri Dec 19 17:03:15 2008 +0100
@@ -460,10 +460,11 @@
             if self.should_inline_relation_form(entity, rschema, targettype, x):
                 result.append(u'<div id="inline%sslot">' % rschema)
                 existant = entity.has_eid() and entity.related(rschema)
-                # display inline-edition view for all existing related entities
-                result.append(self.view('inline-edition', existant, 'null',
-                                        ptype=entity.e_schema, peid=entity.eid,
-                                        rtype=rschema, role=x, **kwargs))
+                if existant:
+                    # display inline-edition view for all existing related entities
+                    result.append(self.view('inline-edition', existant, 
+                                            ptype=entity.e_schema, peid=entity.eid,
+                                            rtype=rschema, role=x, **kwargs))
                 if x == 'subject':
                     card = rschema.rproperty(entity.e_schema, targettype, 'cardinality')[0]
                 else: