diff --git a/www/web/warpauth/templates/warpauth/login.html b/www/web/warpauth/templates/warpauth/login.html index 0e5f383eec06e6608740b8aff8c96b187eb05897..b166d409318a3531a421d0cbe94686c7fa2a8d1f 100644 --- a/www/web/warpauth/templates/warpauth/login.html +++ b/www/web/warpauth/templates/warpauth/login.html @@ -11,9 +11,9 @@ <label for="inputPassword" style="padding-top:10px;">{% trans "Password" %}</label> <input name="password" type="password" id="inputPassword" class="form-control" placeholder="{% trans "Password" %}" required> - {% if fail == True %} + {% if error %} <div class="alert alert-warning alert-dismissible" role="alert"> - <strong>{% trans "Invalid email or password." %}</strong> + <strong>{{ error }}</strong> </div> {% else %} <br> diff --git a/www/web/warpauth/views/login.py b/www/web/warpauth/views/login.py index 42841b2ad8c3d02902d704d986195d567b1d3774..d084429cd70220f8fe3ae0192f15ba5bfa8f927c 100644 --- a/www/web/warpauth/views/login.py +++ b/www/web/warpauth/views/login.py @@ -5,6 +5,7 @@ from django.shortcuts import redirect from django.contrib.auth.decorators import login_required from django.utils import translation from warpauth.util import * +from django.utils.translation import ugettext as _ def login_view(request): pages['page_title'] = "Login" @@ -23,9 +24,11 @@ def login_view(request): translation.activate(user_language) request.session[translation.LANGUAGE_SESSION_KEY] = user_language return redirect('/') + else: + pages['error'] = _("Your account is deactivated. Please contact an administrator.") else: if username != "" and password != "": - pages['fail'] = True + pages['error'] = _("Invalid email or password.") return HttpResponse(render(request, 'warpauth/login.html', pages))