[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 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user