web/views/editcontroller.py
branchstable
changeset 2255 c346af0727ca
parent 1977 606923dff11b
child 2256 0b915d6f4264
--- a/web/views/editcontroller.py	Fri Jul 03 16:50:13 2009 +0200
+++ b/web/views/editcontroller.py	Fri Jul 03 17:57:19 2009 +0200
@@ -25,9 +25,8 @@
 class EditController(ViewController):
     id = 'edit'
 
-    def publish(self, rset=None, fromjson=False):
+    def publish(self, rset=None):
         """edit / create / copy / delete entity / relations"""
-        self.fromjson = fromjson
         for key in self.req.form:
             # There should be 0 or 1 action
             if key.startswith('__action_'):
@@ -115,7 +114,7 @@
             except ValidationError, ex:
                 # ex.entity may be an int or an entity instance
                 self._to_create[formparams['eid']] = ex.entity
-                if self.fromjson:
+                if self.req.json_request: # XXX (syt) why?
                     ex.entity = formparams['eid']
                 raise
             self._to_create[formparams['eid']] = eid