summaryrefslogtreecommitdiff
path: root/django/core/xheaders.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-08-17 15:05:54 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-08-17 15:05:54 +0000
commitfcec755f01cfaba2a85bfc9511876debbce98631 (patch)
treee990effbcd90e4d405b0f9dcc70cb38e47b6f3dc /django/core/xheaders.py
parent0f92ac52cbf81fb2ac01755c558e2e6ad54700e8 (diff)
newforms-admin: Merged from trunk up to [5916]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5918 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/xheaders.py')
-rw-r--r--django/core/xheaders.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/core/xheaders.py b/django/core/xheaders.py
index 3beb930158..34335f12c5 100644
--- a/django/core/xheaders.py
+++ b/django/core/xheaders.py
@@ -4,7 +4,7 @@ information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
-that custom headers are prefxed with "X-").
+that custom headers are prefixed with "X-").
Next time you're at slashdot.org, watch out for X-Fry and X-Bender. :)
"""
@@ -17,6 +17,8 @@ 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 (hasattr(request, 'user') and 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)