[add]: ref_id and ref_model for transactions. And db session and rollback for transactions
This commit is contained in:
@@ -44,9 +44,7 @@ class Repayment(db.Model):
|
||||
|
||||
try:
|
||||
db.session.add(repayment)
|
||||
db.session.commit()
|
||||
except IntegrityError as err:
|
||||
db.session.rollback()
|
||||
raise ValueError(f"Database integrity error: {err}")
|
||||
|
||||
return repayment
|
||||
|
||||
Reference in New Issue
Block a user