diff options
| author | Tom Christie | 2012-01-11 16:43:04 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-01-11 16:43:04 +0000 |
| commit | c71b6fb090b7a225869526b1d75d7e850e85c282 (patch) | |
| tree | 980854681ef4660ca4a09e6af302df55d2ba0951 /djangorestframework/mixins.py | |
| parent | ed8b296e758a67dccf246e4c3ed6da8e94260de3 (diff) | |
| download | django-rest-framework-c71b6fb090b7a225869526b1d75d7e850e85c282.tar.bz2 | |
Replace 'x.has_key(y)' with 'y in x'
Diffstat (limited to 'djangorestframework/mixins.py')
| -rw-r--r-- | djangorestframework/mixins.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py index 09688eb5..8a31d006 100644 --- a/djangorestframework/mixins.py +++ b/djangorestframework/mixins.py @@ -281,13 +281,13 @@ class ResponseMixin(object): # Use _accept parameter override accept_list = [request.GET.get(self._ACCEPT_QUERY_PARAM)] elif (self._IGNORE_IE_ACCEPT_HEADER and - request.META.has_key('HTTP_USER_AGENT') and + 'HTTP_USER_AGENT' in request.META and MSIE_USER_AGENT_REGEX.match(request.META['HTTP_USER_AGENT'])): # Ignore MSIE's broken accept behavior and do something sensible instead accept_list = ['text/html', '*/*'] - elif request.META.has_key('HTTP_ACCEPT'): + elif 'HTTP_ACCEPT' in request.META: # Use standard HTTP Accept negotiation - accept_list = [token.strip() for token in request.META["HTTP_ACCEPT"].split(',')] + accept_list = [token.strip() for token in request.META['HTTP_ACCEPT'].split(',')] else: # No accept header specified accept_list = ['*/*'] |
