added commit
This commit is contained in:
@@ -23,7 +23,7 @@ class Transaction(db.Model):
|
||||
|
||||
@classmethod
|
||||
def create_transaction(cls, transaction_id, account_id, customer_id, type, channel):
|
||||
|
||||
logger.error(f"**Setting Transaction {transaction_id} for Type {type}")
|
||||
if cls.query.filter( and_( cls.transaction_id ==transaction_id, cls.type==type) ).first():
|
||||
logger.error(f"Transaction already exists for {type}")
|
||||
return '' # dont raise - do not crash beacause of this
|
||||
@@ -40,6 +40,7 @@ class Transaction(db.Model):
|
||||
|
||||
try:
|
||||
db.session.add(transaction)
|
||||
db.session.commit()
|
||||
except IntegrityError as err:
|
||||
raise ValueError(f"Database integrity error: {err}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user