Changeset 580
- Timestamp:
- 08/31/05 11:27:59 (3 years ago)
- Files:
-
- django/trunk/django/contrib/comments/views/comments.py (modified) (1 diff)
- django/trunk/django/core/handlers/base.py (modified) (2 diffs)
- django/trunk/django/core/xheaders.py (modified) (1 diff)
- django/trunk/django/middleware/doc.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/comments/views/comments.py
r549 r580 205 205 new_data['content_type_id'] = content_type_id 206 206 new_data['object_id'] = object_id 207 new_data['ip_address'] = request.META ['REMOTE_ADDR']207 new_data['ip_address'] = request.META.get('REMOTE_ADDR') 208 208 new_data['is_public'] = comments.IS_PUBLIC in option_list 209 209 response = HttpResponse() django/trunk/django/core/handlers/base.py
r548 r580 80 80 return self.get_technical_error_response() 81 81 else: 82 subject = 'Database error (%s IP): %s' % ((request.META ['REMOTE_ADDR']in INTERNAL_IPS and 'internal' or 'EXTERNAL'), getattr(request, 'path', ''))82 subject = 'Database error (%s IP): %s' % ((request.META.get('REMOTE_ADDR') in INTERNAL_IPS and 'internal' or 'EXTERNAL'), getattr(request, 'path', '')) 83 83 message = "%s\n\n%s" % (self._get_traceback(), request) 84 84 mail_admins(subject, message, fail_silently=True) … … 90 90 return self.get_technical_error_response() 91 91 else: 92 subject = 'Coding error (%s IP): %s' % ((request.META ['REMOTE_ADDR']in INTERNAL_IPS and 'internal' or 'EXTERNAL'), getattr(request, 'path', ''))92 subject = 'Coding error (%s IP): %s' % ((request.META.get('REMOTE_ADDR') in INTERNAL_IPS and 'internal' or 'EXTERNAL'), getattr(request, 'path', '')) 93 93 try: 94 94 request_repr = repr(request) django/trunk/django/core/xheaders.py
r55 r580 18 18 """ 19 19 from django.conf.settings import INTERNAL_IPS 20 if request.META ['REMOTE_ADDR']in INTERNAL_IPS:20 if request.META.get('REMOTE_ADDR') in INTERNAL_IPS: 21 21 response['X-Object-Type'] = "%s.%s" % (package, python_module_name) 22 22 response['X-Object-Id'] = str(object_id) django/trunk/django/middleware/doc.py
r3 r580 13 13 documentation module to lookup the view function for an arbitrary page. 14 14 """ 15 if request.META['REQUEST_METHOD'] == 'HEAD' and request.META ['REMOTE_ADDR']in settings.INTERNAL_IPS:15 if request.META['REQUEST_METHOD'] == 'HEAD' and request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS: 16 16 response = httpwrappers.HttpResponse() 17 17 response['X-View'] = "%s.%s" % (view_func.__module__, view_func.__name__)
