From e4f78adecafdeb06d855e3bf094ed9869b932e74 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 15 Feb 2019 18:34:10 +0100 Subject: [PATCH] Ask to use another user Make login page Django-complient so now other page can redirect to the login view if the user has unsufficient rights. --- templates/registration/login.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/registration/login.html b/templates/registration/login.html index f4226d7d..ddec89a2 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -29,6 +29,15 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "Log in" %}{% endblock %} {% block content %} + {% if user.is_authenticated %} +

+ {% blocktrans trimmed %} + You are authenticated as {{ username }}, but are not authorized to + access this page. Would you like to login to a different account? + {% endblocktrans %} +

+ {% endif %} +
{% csrf_token %} {% bootstrap_form form %}