Answer the question
In order to leave comments, you need to log in
Check the user to which model is he associated?
What is:
two different users, the user can register as one type or as the second. (customer / executor)
in contecst_processers I want to check what type the user belongs to,
I do this:
def getting_user_type(request):
if (User.objects.filter(email=request.user)):
current_user = request.user
current_user_in_User = User.objects.get(email=current_user)
if current_user_in_User.CustomerProfile:
userTypeCustomer = True
else:
userTypePrinting = True
else:
print("ne ok")
return locals()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question