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
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
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?