          user is a logged-in staff member, quickly return with an x-header
          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)):
              response = http.HttpResponse()
              response['X-View'] = "%s.%s" % (view_func.__module__, view_func.__name__)
              return response
 
</s> remove         if request.user.is_authenticated() and request.user.is_staff:
 </s> add         if request.user.is_staff: </s> remove         if not (request.user.is_authenticated() and request.user.has_perm('polls.can_vote')):
 </s> add         if not request.user.has_perm('polls.can_vote'): </s> remove         return request.user.is_authenticated() and request.user.is_staff
 </s> add         return request.user.is_staff
        if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or request.user.is_staff):
          user is a logged-in staff member, quickly return with an x-header
          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_staff):
              response = http.HttpResponse()
              response['X-View'] = "%s.%s" % (view_func.__module__, view_func.__name__)
              return response
keep keep keep keep replace keep keep keep
 Fixed #6991 -- Removed some redundant user.is_authenticated() calls in various places. Thanks, alexkoshelev, Liang Feng and Ivan Sagalaev

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12142 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/middleware/doc.py