How to restrict Hooks On a Doctype if called from another Doctype?

I have a DocType ‘User’ for which I have created some hooks in file. So whenever the input fields are filled and submitted for that doctype some hooks are called.
Now here’s the thing I have created another hook for User Doctype in another Doctype ‘Organization’ too. And whenever Organization gets created the hooks for Users defined in Organization Class are called. Which also triggers the hooks present in for User Doctype. I want to restrict that.
So what I want to achieve is when I am creating an Organization the hooks for User gets called but no further hooks get called. How do I achieve that? How do I restrict the

Hooks defined in the

"User": {
	"after_insert": [
	"on_update": "core.api.update_volunteer"

class Organization(Document):
def after_insert(self):
	frappe.logger().debug("Adding User")

	user_profile = frappe.get_doc({

Did you find solution ?