mirror of
https://github.com/django/django.git
synced 2025-08-16 08:40:28 +00:00
Fixed #8049 -- Fixed inconsistency in admin site is_active checks. Thanks for patch and tests, isagalaev
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12159 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b651bcb80b
commit
19b72077f7
8 changed files with 29 additions and 6 deletions
|
@ -18,7 +18,7 @@ def populate_xheaders(request, response, model, object_id):
|
|||
"""
|
||||
from django.conf import settings
|
||||
if (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS
|
||||
or (hasattr(request, 'user') and request.user.is_authenticated()
|
||||
or (hasattr(request, 'user') and request.user.is_active
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue