Django 1.9? replaced request.REQUEST with .GET
[htsworkflow.git] / htsworkflow / auth.py
index 1d781e19c3a44dda03bd9aacf4c5201a7010945e..dfbcd27f6cb04b6378a1cb5b124b574265aa40a5 100644 (file)
@@ -8,12 +8,12 @@ apidata = {'apiid': u'0', 'apikey': settings.DEFAULT_API_KEY}
 
 def require_api_key(request):
     # make sure we have the api component
-    if not ('apiid' in request.REQUEST or 'apikey' in request.REQUEST):
+    if not ('apiid' in request.GET or 'apikey' in request.GET):
         raise PermissionDenied
 
     # make sure the id and key are right
-    if request.REQUEST['apiid'] == apidata['apiid'] and \
-       request.REQUEST['apikey'] == apidata['apikey']:
+    if request.GET['apiid'] == apidata['apiid'] and \
+       request.GET['apikey'] == apidata['apikey']:
         return True
     else:
         raise PermissionDenied