Django

Code

Ticket #6991: 6991.2.diff

File 6991.2.diff, 3.3 kB (added by Ivan Sagalaev <Maniac@SoftwareManiacs.Org>, 4 months ago)

New patch with couple more places

  • django/contrib/admin/views/decorators.py

    old new  
    5252    member, displaying the login page if necessary. 
    5353    """ 
    5454    def _checklogin(request, *args, **kwargs): 
    55         if request.user.is_authenticated() and request.user.is_staff: 
     55        if request.user.is_staff: 
    5656            # The user is valid. Continue to the admin page. 
    5757            if 'post_data' in request.POST: 
    5858                # User must have re-authenticated through a different window 
  • django/contrib/admin/templates/admin/base.html

    old new  
    2121        <div id="branding"> 
    2222        {% block branding %}{% endblock %} 
    2323        </div> 
    24         {% if user.is_authenticated and user.is_staff %} 
     24        {% if user.is_staff %} 
    2525        <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div> 
    2626        {% endif %} 
    2727        {% block nav-global %}{% endblock %} 
  • django/contrib/admin/sites.py

    old new  
    9292        Returns True if the given HttpRequest has permission to view 
    9393        *at least one* page in the admin site. 
    9494        """ 
    95         return request.user.is_authenticated() and request.user.is_staff 
     95        return request.user.is_staff 
    9696 
    9797    def root(self, request, url): 
    9898        """  
  • django/middleware/doc.py

    old new  
    1212        indicating the view function.  This is used by the documentation module 
    1313        to lookup the view function for an arbitrary page. 
    1414        """ 
    15         if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (request.user.is_authenticated() and request.user.is_staff)): 
     15        if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or request.user.is_staff): 
    1616            response = http.HttpResponse() 
    1717            response['X-View'] = "%s.%s" % (view_func.__module__, view_func.__name__) 
    1818            return response 
  • docs/authentication.txt

    old new  
    712712permission ``polls.can_vote``:: 
    713713 
    714714    def my_view(request): 
    715         if not (request.user.is_authenticated() and request.user.has_perm('polls.can_vote')): 
     715        if not request.user.has_perm('polls.can_vote'): 
    716716            return HttpResponse("You can't vote in this poll.") 
    717717        # ... 
    718718