mirror of
https://github.com/chibicitiberiu/ytsm.git
synced 2024-02-24 05:43:31 +00:00
Show error message if not allowed to access admin page.
This commit is contained in:
@ -4,8 +4,16 @@
|
||||
{% block body %}
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1>Admin settings</h1>
|
||||
{% crispy form %}
|
||||
|
||||
{% if not request.user.is_authenticated or not request.user.is_superuser %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
You must be an administrator to access this page!
|
||||
</div>
|
||||
{% else %}
|
||||
{% crispy form %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock body %}
|
Reference in New Issue
Block a user