web/views/autoform.py
changeset 5774 0d792bceb25d
parent 5696 98d390c28edb
parent 5769 b3b48e0b8e3b
child 5849 9db65b381028
--- a/web/views/autoform.py	Thu Jun 17 14:43:16 2010 +0200
+++ b/web/views/autoform.py	Thu Jun 17 15:15:52 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):