Ticket #6991: 6991.diff

File 6991.diff, 2.0 KB (added by Alexander Koshelev, 16 years ago)

Patch for this ticket and #6990

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

     
    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

     
    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 %}
  • docs/authentication.txt

     
    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        # ...
Back to Top