How to assign custom role while creating a new user

Hello,

I’m creating a custom app on frappe, the app creates a new user and assigns Website User by default. How can I assign role from code when creating new users so that they can be System User’s ?

Thanks

Insert required Role in the Has Role (hidden) table.

Hello @umair, It worked thanks !!