Skip to content

Commit

Permalink
Add checking if user has access to admin (user.is_staff) before
Browse files Browse the repository at this point in the history
showing "Go to admin" button in error template.
  • Loading branch information
darklow committed Jul 11, 2014
1 parent b2db0fe commit 1c2a01c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion suit/templates/suit/error_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h1>{% block title %}Error{% endblock %}</h1>
if (document.referrer != '') {
document.write('<a href="javascript:history.back()" class="btn btn-info btn-large">Go back</a> ');
}
{% if request and user.is_authenticated %}
{% if request and user.is_authenticated and user.is_staff %}
document.write('<a href="{% url 'admin:index' %}" class="btn btn-large">Go to admin home</a> ');
{% endif %}
}
Expand Down

0 comments on commit 1c2a01c

Please sign in to comment.