added loop

This commit is contained in:
Chinenye Nmoh
2025-06-19 23:23:06 +01:00
parent 7fbb659fc6
commit 684833bd66
2 changed files with 36 additions and 32 deletions
+2 -1
View File
@@ -227,5 +227,6 @@ class Loan(db.Model):
"""
customer_loans = cls.query.filter_by( customer_id = customer_id).all()
if not customer_loans:
raise ValueError(f"Customer with Id {customer_id} does not have any loan.")
raise ValueError(f"Customer with Id {customer_id} does not have any loan.")
logger.info(f"Found {len(customer_loans)} loans for customer ID: {customer_id}")
return customer_loans