web/views/autoform.py
branchstable
changeset 5769 b3b48e0b8e3b
parent 5695 85bafafc1f22
child 5774 0d792bceb25d
child 5835 4125a8021956
--- a/web/views/autoform.py	Thu Jun 17 14:42:41 2010 +0200
+++ b/web/views/autoform.py	Thu Jun 17 15:02:22 2010 +0200
@@ -296,12 +296,13 @@
         # the 'add a new xxx' link disappears. If the user then cancel the addition,
         # we have to make this link appears back. This is done by giving add new link
         # id to removeInlineForm.
-        if card not in '?1':
+        if card == '?':
+            divid = "addNew%s%s%s:%s" % (self.etype, self.rtype, self.role, self.peid)
+            return "removeInlineForm('%%s', '%%s', '%s', '%%s', '%s')" % (
+                self.role, divid)
+        elif card in '+*':
             return "removeInlineForm('%%s', '%%s', '%s', '%%s')" % self.role
-        divid = "addNew%s%s%s:%s" % (
-            self.etype, self.rtype, self.role, self.peid)
-        return "removeInlineForm('%%s', '%%s', '%s', '%%s', '%s')" % (
-            self.role, divid)
+        # don't do anything for card == '1'
 
     @cached
     def _entity(self):