Django

Code

Changeset 4090

Show
Ignore:
Timestamp:
11/22/06 22:34:45 (2 years ago)
Author:
adrian
Message:

Fixed bug in [3786]. django/core/xheaders.py no longer assumes request.user exists

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/xheaders.py

    r3786 r4090  
    1818    """ 
    1919    from django.conf import settings 
    20     if request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (request.user.is_authenticated() and request.user.is_staff): 
     20    if request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (hasattr(request, 'user') and request.user.is_authenticated() and request.user.is_staff): 
    2121        response['X-Object-Type'] = "%s.%s" % (model._meta.app_label, model._meta.object_name.lower()) 
    2222        response['X-Object-Id'] = str(object_id)