Duplicate Contact and Unexpected Customer Created When Website User Is Registered

Hi Frappe Team,

I’m using ERPNext along with Frappe’s Shop Site. When a new Website User registers (just by creating a user with “Website User” role), the system unexpectedly creates:

  1. A Contact like “Mohamed Ali”
  2. Another Contact like “Mohamed Ali-CUST-000022”
  3. A Customer document (even though I didn’t set up anything to auto-create one)

So basically, just by creating a user, I end up with:

  • 2 Contact records (one plain, one tied to a Customer)
  • 1 Customer record

I believe only 1 Contact should be created, and Customer should only be created if user places an order or something similar.

I looked into the hooks and the user.py file but couldn’t figure out which function is triggering these extra documents.

Can someone guide me to:

  • Which functions or hooks are responsible for this?
  • How to prevent the duplicate Contact and unwanted Customer from being created?

Thanks a lot!

ERPNext Version: v15.57.3 (version-15)
Frappe Version: v15.63.1 (version-15)