Problem to retrieve user type in custom submit_line.html template

14 views
Skip to first unread message

Alessandro Peretti

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

I have a problem with my submit_line.html. I added a button through " input type="submit" value="{% trans 'Send Email' %}" name="_send_email" />" to send an email. In my admin.py of my app I override the save_model method to send an email and save the new istance created inside the database. For this everything is good and work. Furthermore, I want to show my new button just for the staff users and not for the superusers. but it doesn't work. To do this I added {% if request.user.is_superuser%} but it doesn't work. It seems that  the variable user is outside the scope. How can I fix this?

Thanks in advance, 

Alessandro. :)
Reply all
Reply to author
Forward
0 new messages