From bbe136e1a2f9cbf3fd10d49fbe8558a5b394752c Mon Sep 17 00:00:00 2001 From: Sjoerd Job Postmus Date: Wed, 17 Feb 2016 15:18:24 +0100 Subject: [PATCH] Fixed #26231 -- Used .get_username in admin login template. --- django/contrib/admin/templates/admin/login.html | 2 +- docs/releases/1.9.3.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/templates/admin/login.html b/django/contrib/admin/templates/admin/login.html index a955c871f76..4c0dc63dcf1 100644 --- a/django/contrib/admin/templates/admin/login.html +++ b/django/contrib/admin/templates/admin/login.html @@ -34,7 +34,7 @@ {% if user.is_authenticated %}

-{% blocktrans with username=request.user.username trimmed %} +{% blocktrans with username=request.user.get_username trimmed %} You are authenticated as {{ username }}, but are not authorized to access this page. Would you like to login to a different account? {% endblocktrans %} diff --git a/docs/releases/1.9.3.txt b/docs/releases/1.9.3.txt index cd7d6748642..ef956810242 100644 --- a/docs/releases/1.9.3.txt +++ b/docs/releases/1.9.3.txt @@ -42,3 +42,7 @@ Bugfixes regressed in Django 1.9 (:ticket:`26253`). * Fixed ``BoundField`` to reallow slices of subwidgets (:ticket:`26267`). + +* Changed the admin's "permission denied" message in the login template to use + ``get_username`` instead of ``username`` to support custom user models + (:ticket:`26231`).