Re: Set different value for a field when Admin creates an user

2019-11-29 Thread Sencer Hamarat
Check request.user.is_superuser. If it return True, the role of the user signed in is Admin. Saygılarımla, Sencer HAMARAT On Fri, Nov 29, 2019 at 3:41 PM Fruity Code wrote: > I have an updated user model and added two fields to it, mobile_number and > role. The field role has two options Cust

Set different value for a field when Admin creates an user

2019-11-29 Thread Fruity Code
I have an updated user model and added two fields to it, mobile_number and role. The field role has two options Customer and Admin. Currently, I have made customer as the default value for role. Now what I want is when user signup the role should be a customer but when an admin create a user fro