mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-23 14:24:34 +02:00
fix: commit the bulk ACE deletion in the repository
delete_all_ace_starting_with_path was the only RBAC write method without a commit. The request session is only closed at teardown, so the deletion was rolled back and the ACEs came back on the next snapshot reload. Tests did not catch it because they share one session for the whole class.
This commit is contained in:
2 files changed
+22
No files matched your search
@@ -295,6 +295,7 @@ class RbacRepository(BaseRepository):
|
||||
|
||||
query = delete(models.ACE).where(models.ACE.path.startswith(path)).execution_options(synchronize_session=False)
|
||||
result = await self._db_session.execute(query)
|
||||
await self._db_session.commit()
|
||||
self._rbac_state.mark_dirty()
|
||||
log.debug(f"{cast(CursorResult, result).rowcount} ACE(s) have been deleted")
|
||||
|
||||
|
||||
Reference in new issue
Block a user