# HG changeset patch # User Denis Laxalde # Date 1393422613 -3600 # Node ID 048d6de92b63980b7a25dcd2112da7542af96e2b # Parent 7e4897901c6474e818b1805c12ca7b2ec87a7e96 Make EditController edit_entity method always return an eid In cases the entity was to be created or copied, eid was None hence the method returned None despite the dosctring says the method should always return an eid. Now if the eid variable is None, it is assigned to the newly created entity eid. Closes #3593029. diff -r 7e4897901c64 -r 048d6de92b63 web/views/editcontroller.py --- a/web/views/editcontroller.py Wed Mar 26 11:08:09 2014 +0100 +++ b/web/views/editcontroller.py Wed Feb 26 14:50:13 2014 +0100 @@ -272,7 +272,7 @@ errors = dict((f.role_name(), unicode(ex)) for f, ex in self.errors) raise ValidationError(valerror_eid(entity.eid), errors) if eid is None: # creation or copy - entity.eid = self._insert_entity(etype, formparams['eid'], rqlquery) + entity.eid = eid = self._insert_entity(etype, formparams['eid'], rqlquery) elif rqlquery.edited: # edition of an existant entity self._update_entity(eid, rqlquery) if is_main_entity: