autoflush should be passed as an option to db.get_session.

This commit is contained in:
Fabio Manganiello 2022-12-10 16:20:14 +01:00
parent 6a2a3100f8
commit c4f649a0d5
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -514,7 +514,7 @@ class DbPlugin(Plugin):
@contextmanager @contextmanager
def get_session( def get_session(
self, engine=None, locked=False, *args, **kwargs self, engine=None, locked=False, autoflush=True, *args, **kwargs
) -> Generator[Session, None, None]: ) -> Generator[Session, None, None]:
engine = self.get_engine(engine, *args, **kwargs) engine = self.get_engine(engine, *args, **kwargs)
if locked: if locked:
@ -527,7 +527,7 @@ class DbPlugin(Plugin):
session = scoped_session( session = scoped_session(
sessionmaker( sessionmaker(
expire_on_commit=False, expire_on_commit=False,
autoflush=True, autoflush=autoflush,
) )
) )