diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-11-23 04:34:45 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-11-23 04:34:45 +0000 |
| commit | 23e21df9ca9d9605f076fa395fa6f1547958305f (patch) | |
| tree | c9a931a29414028920c495e3b0e97c045d3220f0 | |
| parent | 5bafb499e7647bb0829d566538c1c8d621bdee0f (diff) | |
Fixed bug in [3786]. django/core/xheaders.py no longer assumes request.user exists
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4090 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/xheaders.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/xheaders.py b/django/core/xheaders.py index 69f6115839..3beb930158 100644 --- a/django/core/xheaders.py +++ b/django/core/xheaders.py @@ -17,6 +17,6 @@ def populate_xheaders(request, response, model, object_id): or if the request is from a logged in staff member. """ from django.conf import settings - if request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (request.user.is_authenticated() and request.user.is_staff): + if request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (hasattr(request, 'user') and request.user.is_authenticated() and request.user.is_staff): response['X-Object-Type'] = "%s.%s" % (model._meta.app_label, model._meta.object_name.lower()) response['X-Object-Id'] = str(object_id) |
