X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=blobdiff_plain;f=htsworkflow%2Ffrontend%2Fauth.py;fp=htsworkflow%2Ffrontend%2Fauth.py;h=bd1771b58f1144bbded017d74d4c94c7a5d7f7be;hp=31650a6bb56d6189503a8e6a04d6240c8330459f;hb=53ebb47e86e81ce349d4ef4e16aef94be93486ea;hpb=4262586d10cc0cc227390873b301b55244204c11 diff --git a/htsworkflow/frontend/auth.py b/htsworkflow/frontend/auth.py index 31650a6..bd1771b 100644 --- a/htsworkflow/frontend/auth.py +++ b/htsworkflow/frontend/auth.py @@ -4,11 +4,11 @@ Define some alternate authentication methods from django.core.exceptions import PermissionDenied from django.conf import settings -apidata = {'apiid': u'0', 'apikey': settings.DEFAULT_API_KEY} +apidata = {'apiid': '0', 'apikey': settings.DEFAULT_API_KEY} def require_api_key(request): # make sure we have the api component - if not (request.REQUEST.has_key('apiid') or request.REQUEST.has_key('apikey')): + if not ('apiid' in request.REQUEST or 'apikey' in request.REQUEST): raise PermissionDenied # make sure the id and key are right