Index: django/contrib/admin/views/decorators.py
===================================================================
--- django/contrib/admin/views/decorators.py (revision 7901)
+++ django/contrib/admin/views/decorators.py (working copy)
@@ -52,7 +52,7 @@
member, displaying the login page if necessary.
"""
def _checklogin(request, *args, **kwargs):
- if request.user.is_authenticated() and request.user.is_staff:
+ if request.user.is_staff:
# The user is valid. Continue to the admin page.
if 'post_data' in request.POST:
# User must have re-authenticated through a different window
Index: django/contrib/admin/templates/admin/base.html
===================================================================
--- django/contrib/admin/templates/admin/base.html (revision 7901)
+++ django/contrib/admin/templates/admin/base.html (working copy)
@@ -21,7 +21,7 @@
{% block branding %}{% endblock %}
- {% if user.is_authenticated and user.is_staff %}
+ {% if user.is_staff %}
{% endif %}
{% block nav-global %}{% endblock %}
Index: django/contrib/admin/sites.py
===================================================================
--- django/contrib/admin/sites.py (revision 7901)
+++ django/contrib/admin/sites.py (working copy)
@@ -92,7 +92,7 @@
Returns True if the given HttpRequest has permission to view
*at least one* page in the admin site.
"""
- return request.user.is_authenticated() and request.user.is_staff
+ return request.user.is_staff
def root(self, request, url):
"""
Index: django/middleware/doc.py
===================================================================
--- django/middleware/doc.py (revision 7901)
+++ django/middleware/doc.py (working copy)
@@ -12,7 +12,7 @@
indicating the view function. This is used by the documentation module
to lookup the view function for an arbitrary page.
"""
- if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (request.user.is_authenticated() and request.user.is_staff)):
+ if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or request.user.is_staff):
response = http.HttpResponse()
response['X-View'] = "%s.%s" % (view_func.__module__, view_func.__name__)
return response
Index: docs/authentication.txt
===================================================================
--- docs/authentication.txt (revision 7901)
+++ docs/authentication.txt (working copy)
@@ -712,7 +712,7 @@
permission ``polls.can_vote``::
def my_view(request):
- if not (request.user.is_authenticated() and request.user.has_perm('polls.can_vote')):
+ if not request.user.has_perm('polls.can_vote'):
return HttpResponse("You can't vote in this poll.")
# ...