Skip to content

Commit

Permalink
fix(sqlalchemy): check if sesison has autoflush attribute
Browse files Browse the repository at this point in the history
Tests were braking, this will fix it.

Refs: #449
  • Loading branch information
piraz committed Apr 22, 2024
1 parent c7898ac commit 7e175c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firenado/sqlalchemy.py
Expand Up @@ -133,7 +133,7 @@ def wrapper(self, *method_args, **method_kwargs):
if not session:
logger.warning("No session was resolved.")
logger.debug("Closing session %s.", session)
if not session.autoflush:
if hasattr(session, "autoflush") and not session.autoflush:
session.flush()
session.close()
return result
Expand Down

0 comments on commit 7e175c4

Please sign in to comment.