Jan-12-2020, 04:23 PM
i need to search customers by their last name in order to allow the admin user to have access to the customers account.
i have already created the admin search but can sombody tell me why the search_customers_by_name is not working
i have already created the admin search but can sombody tell me why the search_customers_by_name is not working
def search_admins_by_name(self, admin_username):
#STEP A.2
found_admin = None
for a in self.admins_list:
username = a.get_username()
if username == admin_username:
found_admin = a
break
if found_admin == None:
print("\n The Admin %s does not exist! Try again...\n" %admin_username)
return found_admin
def search_customers_by_name(self, customer_lname):
#STEP A.3
found_account = None
for a in self.accounts_list:
lname = a.get_last_name()
if lname == customer_lname:
found_account = a
break
if found_account == None:
print("\n The account does not exist! Try again...\n" %customer_lname)
return found_account
