Skip to content

Commit

Permalink
Fixed #4933 -- Fixed a typo and reformatted a fairly long line in pas…
Browse files Browse the repository at this point in the history
…sing. Thanks, Ludvig Ericson.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5870 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Aug 12, 2007
1 parent a564adb commit 534671a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django/core/xheaders.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This module contains utility functions for retrieving and doing interesting This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands 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. :) Next time you're at slashdot.org, watch out for X-Fry and X-Bender. :)
""" """
Expand All @@ -17,6 +17,8 @@ def populate_xheaders(request, response, model, object_id):
or if the request is from a logged in staff member. or if the request is from a logged in staff member.
""" """
from django.conf import settings 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-Type'] = "%s.%s" % (model._meta.app_label, model._meta.object_name.lower())
response['X-Object-Id'] = str(object_id) response['X-Object-Id'] = str(object_id)

0 comments on commit 534671a

Please sign in to comment.