Issue: get user type in custom submit_line.html template

19 views
Skip to first unread message

Alessandro Peretti

unread,
Dec 2, 2015, 11:05:29 AM12/2/15
to Django users
Hi folk,

I added a submit button in submit_line.html. I want to show it just for staff users and not for superusers.
So I inserted {% if request.user.is_superuser %} but it doesn't work. 
It seems that the django variable user is outside this scope. 
How can I fix it?

Thanks in advance.

Caique Reinhold

unread,
Dec 4, 2015, 2:10:02 PM12/4/15
to Django users
You should actually use user.is_staff to check for staff members. If the variable user is not available you should check if the auth app is correctly setup in your project.
Reply all
Reply to author
Forward
0 new messages