From e78e7402c8cea8a7f99ebe702b4e97899ff366ef Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Tue, 11 Nov 2025 21:35:56 +0100 Subject: [PATCH] Update customer.py --- app/models/customer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/customer.py b/app/models/customer.py index 1469dad..0a3c1e3 100644 --- a/app/models/customer.py +++ b/app/models/customer.py @@ -47,11 +47,11 @@ class Customer(db.Model): @classmethod def create_customer(cls, id, msisdn, country_code, account_id, account_type='savings'): if cls.query.filter_by(id=id).first(): - raise ValueError("Customer already exists") + raise ValueError("Customer ID '{id}' already exists.") elif Account.query.filter_by(id=account_id).first(): - raise ValueError("Account already exists") + raise ValueError(f"Account ID '{account_id}' already exists.") elif cls.query.filter_by(msisdn=msisdn).first(): - raise ValueError("msisdn already exists") + raise ValueError("MSISDN '{msisdn}' already exists") # Create the customer customer = cls(