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 untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

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