mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Initial commit for sqlalchemy2.0 migration
This commit is contained in:
@@ -12,7 +12,7 @@ def autocommit(func):
|
||||
try:
|
||||
res = func(*args, **kwargs)
|
||||
|
||||
if not db.session.registry().transaction.nested:
|
||||
if not db.session.is_active:
|
||||
db.session.commit()
|
||||
|
||||
return res
|
||||
@@ -30,7 +30,7 @@ def transaction():
|
||||
yield
|
||||
db.session.commit()
|
||||
|
||||
if not db.session.registry().transaction.nested:
|
||||
if not db.session.is_active:
|
||||
db.session.commit()
|
||||
except Exception:
|
||||
db.session.rollback()
|
||||
|
||||
Reference in New Issue
Block a user