From 74d820fd0ad7e9e8ae02434d535cf775840dff3f Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 1 Jun 2021 15:55:50 +0930 Subject: [PATCH] Use synchronize_session="fetch" when updating values. --- gns3server/db/repositories/rbac.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gns3server/db/repositories/rbac.py b/gns3server/db/repositories/rbac.py index 98c159c6..e71a25f0 100644 --- a/gns3server/db/repositories/rbac.py +++ b/gns3server/db/repositories/rbac.py @@ -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()