1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #26035 -- Prevented user-tools from appearing on admin logout page.

This commit is contained in:
Scott Pashley
2016-01-05 11:29:09 +00:00
committed by Tim Graham
parent 62e83c71d2
commit 7cc2efc2d6
5 changed files with 18 additions and 7 deletions

View File

@@ -372,7 +372,13 @@ class AdminSite(object):
"""
from django.contrib.auth.views import logout
defaults = {
'extra_context': dict(self.each_context(request), **(extra_context or {})),
'extra_context': dict(
self.each_context(request),
# Since the user isn't logged out at this point, the value of
# has_permission must be overridden.
has_permission=False,
**(extra_context or {})
),
}
if self.logout_template is not None:
defaults['template_name'] = self.logout_template