err.entity may only be an eid or None at this point stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 May 2009 10:05:19 +0200
branchstable
changeset 1857 46f975203f4f
parent 1856 b0a6e34ba11b
child 1858 69e41c88e195
err.entity may only be an eid or None at this point
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Tue May 19 10:04:15 2009 +0200
+++ b/web/views/basecontrollers.py	Tue May 19 10:05:19 2009 +0200
@@ -382,11 +382,7 @@
             ctrl.publish(None, fromjson=True)
         except ValidationError, err:
             self.req.cnx.rollback()
-            if not err.entity or isinstance(err.entity, (long, int)):
-                eid = err.entity
-            else:
-                eid = err.entity.eid
-            return (False, (eid, err.errors))
+            return (False, (err.entity, err.errors))
         except Redirect, redir:
             return (True, redir.location)
         except Exception, err: