#26035: usertools block in admin console visible after logout
-------------------------------------+-------------------------------------
     Reporter:  scottpashley         |                    Owner:
                                     |  scottpashley
         Type:  Bug                  |                   Status:  new
    Component:  contrib.admin        |                  Version:  1.8
     Severity:  Release blocker      |               Resolution:
     Keywords:  admin, logout, ui    |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  1
-------------------------------------+-------------------------------------

Comment (by scottpashley):

 Replying to [comment:1 timgraham]:
 > Seems to be a regression in 46068d850d8debd3611ed6499d48b9907bf07ef6,
 however, the suggested fix doesn't work (unless I got misinterpreted what
 you meant).
 > {{{#!diff
 > diff --git a/django/contrib/admin/sites.py
 b/django/contrib/admin/sites.py
 > index af40880..2dc0d99 100644
 > --- a/django/contrib/admin/sites.py
 > +++ b/django/contrib/admin/sites.py
 > @@ -159,7 +159,7 @@ class AdminSite(object):
 >          Returns True if the given HttpRequest has permission to view
 >          *at least one* page in the admin site.
 >          """
 > -        return request.user.is_active and request.user.is_staff
 > +        return request.user.is_authenticated() and
 request.user.is_active and request.user.is_staff
 >
 >      def check_dependencies(self):
 >          """
 > }}}



 Apologies, it would be in the html template :


 {{{#!diff
 diff --git a/django/contrib/admin/templates/admin/base.html
 b/django/contrib/admin/templates/admin/base.html
 index 70e137c..47e4cad 100644
 --- a/django/contrib/admin/templates/admin/base.html
 +++ b/django/contrib/admin/templates/admin/base.html
 @@ -24,7 +24,7 @@
          {% block branding %}{% endblock %}
          </div>
          {% block usertools %}
 -        {% if has_permission %}
 +        {% if has_permission and user.is_authenticated %}
          <div id="user-tools">
              {% block welcome-msg %}
                  {% trans 'Welcome,' %}
 }}}

 Scott

--
Ticket URL: <https://code.djangoproject.com/ticket/26035#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.387716320882d29f128781aae3a4b1f7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to