MCPcopy Create free account
hub / github.com/geekcomputers/Python / update_customer

Method update_customer

bank_managment_system/backend.py:101–107  ·  view source on GitHub ↗
(self, field, new_value, acc_no)

Source from the content-addressed store, hash-verified

99 return self.cur.fetchone()
100
101 def update_customer(self, field, new_value, acc_no):
102 if field not in {"name", "age", "address", "mobile_number", "account_type"}:
103 raise ValueError("Invalid customer field")
104 self.cur.execute(
105 f"UPDATE bank SET {field}=? WHERE acc_no=?", (new_value, acc_no)
106 )
107 self.conn.commit()
108
109 def update_balance(self, amount, acc_no):
110 self.cur.execute(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected