restore vital block of code (gone in 6384:89d5b339ebdd)
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 06 Oct 2010 11:57:21 +0200
changeset 6400 21468682f688
parent 6397 66401ba9332a
child 6401 d7f5d873e1b8
restore vital block of code (gone in 6384:89d5b339ebdd)
web/views/editcontroller.py
--- a/web/views/editcontroller.py	Tue Oct 05 10:17:24 2010 +0200
+++ b/web/views/editcontroller.py	Wed Oct 06 11:57:21 2010 +0200
@@ -119,6 +119,16 @@
         # no specific action, generic edition
         self._to_create = req.data['eidmap'] = {}
         self._pending_fields = req.data['pendingfields'] = set()
+        try:
+            for eid in req.edited_eids():
+                # __type and eid
+                formparams = req.extract_entity_params(eid, minparams=2)
+                eid = self.edit_entity(formparams)
+        except (RequestError, NothingToEdit), ex:
+            if '__linkto' in req.form and 'eid' in req.form:
+                self.execute_linkto()
+            elif not ('__delete' in req.form or '__insert' in req.form):
+                raise ValidationError(None, {None: unicode(ex)})
         # handle relations in newly created entities
         if self._pending_fields:
             for form, field in self._pending_fields: