Override Non Whitelisted Methods?f

How to override normal functions?

like force_user_to_reset_password function in auth.py

Reference: How to use doctypes from erpnext to custom app - #2 by NCP

This is not a doctype class this is normal class in auth.py can we override this with the above methods you shared @NCP ?

Possible with Monkey Patch, but we do not recommend overriding the doctype class method or using monkey patches. and reference is already available in the forum so find it.

Hi @NCP ,

I overrode the LoginManager class as you showed in the video for SalesOrder in the same way, but it didn’t work. So, I think the override_doctype_class hook will only work for DocTypes and not for normal classes defined in the framework. If I want to override any methods in the LoginManager class, is there any way to do it other than monkey patching? You mentioned that monkey patching is not recommended.

Thanks!

No … !

Okay will go with Monkey Patching Thanks @NCP for the immediate response :hugs: