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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.