From 37722d12cd76c93b3c8179e9dae51ef95cf665f2 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 24 Apr 2023 23:55:50 +0200 Subject: [PATCH] No need for `session.begin` in `db.create_all`. --- platypush/plugins/db/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/db/__init__.py b/platypush/plugins/db/__init__.py index 74b76eed66..b5a83df314 100644 --- a/platypush/plugins/db/__init__.py +++ b/platypush/plugins/db/__init__.py @@ -530,7 +530,7 @@ class DbPlugin(Plugin): connection.execute(delete) def create_all(self, engine, base): - with self.get_session(engine, locked=True) as session, session.begin(): + with self.get_session(engine, locked=True) as session: base.metadata.create_all(session.connection()) @contextmanager