Skip to content

Commit

Permalink
Show admin link only when request and request.user variables are
Browse files Browse the repository at this point in the history
available. Otherwise django test "test_middleware_disabled" fails.
Fixes #90
  • Loading branch information
darklow committed Feb 24, 2014
1 parent 883db74 commit 3efadb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions suit/templates/suit/error_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ <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 request.user %}
document.write('<a href="{% url 'admin:index' %}" class="btn btn-large">Go to admin home</a> ');
{% endif %}
}
</script>
</div>
Expand Down

0 comments on commit 3efadb2

Please sign in to comment.