mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-17 17:24:51 +02:00
Use synchronize_session="fetch" when updating values.
This commit is contained in:
parent
e9b9884ee3
commit
74d820fd0a
@ -94,7 +94,10 @@ class RbacRepository(BaseRepository):
|
||||
"""
|
||||
|
||||
update_values = role_update.dict(exclude_unset=True)
|
||||
query = update(models.Role).where(models.Role.role_id == role_id).values(update_values)
|
||||
query = update(models.Role).\
|
||||
where(models.Role.role_id == role_id).\
|
||||
values(update_values).\
|
||||
execution_options(synchronize_session="fetch")
|
||||
|
||||
await self._db_session.execute(query)
|
||||
await self._db_session.commit()
|
||||
@ -230,7 +233,10 @@ class RbacRepository(BaseRepository):
|
||||
"""
|
||||
|
||||
update_values = permission_update.dict(exclude_unset=True)
|
||||
query = update(models.Permission).where(models.Permission.permission_id == permission_id).values(update_values)
|
||||
query = update(models.Permission).\
|
||||
where(models.Permission.permission_id == permission_id).\
|
||||
values(update_values).\
|
||||
execution_options(synchronize_session="fetch")
|
||||
|
||||
await self._db_session.execute(query)
|
||||
await self._db_session.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user