Merge "Update method improved in db api"

This commit is contained in:
Jenkins 2014-06-16 13:45:43 +00:00 committed by Gerrit Code Review
commit 9f5fb6bd6a

View File

@ -225,9 +225,14 @@ def entity_update(kls, entity_id, values):
if entity is None:
raise exc.NotFound("%s %s not found" % (kls.__name__, entity_id))
entity.update(values.copy())
values_copy = values.copy()
values_copy["id"] = entity_id
entity.update(values_copy)
session.add(entity)
session = get_session()
entity = __entity_get(kls, entity_id, session)
return entity