mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
UIDs can come in as strings or longs, check for that instead
This commit is contained in:
@@ -51,7 +51,7 @@ class CachedDocumentManager(models.Manager):
|
||||
conn.request(method, url_path, paramstr, headers)
|
||||
response = conn.getresponse()
|
||||
|
||||
print url_path, paramstr, response.status
|
||||
print service, url_path, paramstr, response.status
|
||||
|
||||
if response.status == 200:
|
||||
doc_id = self.get_document_id(url_path, params)
|
||||
@@ -68,7 +68,7 @@ class CachedDocumentManager(models.Manager):
|
||||
cached_doc.cached_until = dom.getElementsByTagName('cachedUntil')[0].childNodes[0].nodeValue
|
||||
|
||||
# If this is user related, write a log instance
|
||||
if params and 'userID' in params and params['userID'].isdigit():
|
||||
if params and 'userID' in params and type(params['userID']) == long:
|
||||
log = ApiAccessLog()
|
||||
log.userid = params['userID']
|
||||
log.service = service
|
||||
|
||||
@@ -31,7 +31,7 @@ def retrieve_xml(request):
|
||||
try:
|
||||
cached_doc = CachedDocument.objects.api_query(url_path, params, exceptions=False)
|
||||
except:
|
||||
return HttpResponseServerError
|
||||
return HttpResponseServerError('Error occured')
|
||||
|
||||
if cached_doc:
|
||||
return HttpResponse(cached_doc.body, mimetype='text/xml')
|
||||
|
||||
Reference in New Issue
Block a user