Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed bug in [3786]. django/core/ no longer assumes reques…

…t.user exists

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 23e21df9ca9d9605f076fa395fa6f1547958305f 1 parent 5bafb49
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/core/
2  django/core/
@@ -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)

0 comments on commit 23e21df

Please sign in to comment.
Something went wrong with that request. Please try again.