Merge "Update method improved in db api"
This commit is contained in:
commit
9f5fb6bd6a
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user