]> git.ozlabs.org Git - patchwork/commitdiff
Use the 'in' operator instead of dict.has_key(), which has been deprecated
authorGuilherme Salgado <guilherme.salgado@linaro.org>
Mon, 28 Feb 2011 02:39:36 +0000 (02:39 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 30 Mar 2011 06:39:26 +0000 (14:39 +0800)
Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/views/base.py
apps/patchwork/views/xmlrpc.py

index 2f6b602f18ae68e16a692aefda049ef3987c1d0d..c0e68ed409034b6ed16715b2702f4927a77f3b3d 100644 (file)
@@ -76,7 +76,7 @@ if settings.ENABLE_XMLRPC:
 
 def help(request, path):
     context = PatchworkRequestContext(request)
-    if help_pages.has_key(path):
+    if path in help_pages:
         return render_to_response('patchwork/help/' + help_pages[path], context)
     raise Http404
 
index 1d9d389c528a815342d6953b5b8b47147fe8a21f..8e8b78c1bed7a2f82a42d781b7fcd4b325ca2c96 100644 (file)
@@ -58,9 +58,9 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher):
     def _user_for_request(self, request):
         auth_header = None
 
-        if request.META.has_key('HTTP_AUTHORIZATION'):
+        if 'HTTP_AUTHORIZATION' in request.META:
             auth_header = request.META.get('HTTP_AUTHORIZATION')
-        elif request.META.has_key('Authorization'):
+        elif 'Authorization' in request.META:
             auth_header = request.META.get('Authorization')
 
         if auth_header is None or auth_header == '':