[add]: ref_id and ref_model for transactions. And db session and rollback for transactions

This commit is contained in:
VivianDee
2025-04-10 23:06:51 +01:00
parent e5320c075e
commit a196d4d3c4
14 changed files with 123 additions and 88 deletions
-2
View File
@@ -44,9 +44,7 @@ class Customer(db.Model):
account_type=account_type
)
db.session.commit()
except IntegrityError as err:
db.session.rollback()
raise ValueError(f"Database integrity error: {err}")
return customer