mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Wrap cache retrieval function for web access method
This commit is contained in:
@@ -28,7 +28,10 @@ def retrieve_xml(request):
|
|||||||
if 'userID' in params and not 'service' in params:
|
if 'userID' in params and not 'service' in params:
|
||||||
return HttpResponse('No Service ID provided.')
|
return HttpResponse('No Service ID provided.')
|
||||||
|
|
||||||
cached_doc = CachedDocument.objects.api_query(url_path, params, exceptions=False)
|
try:
|
||||||
|
cached_doc = CachedDocument.objects.api_query(url_path, params, exceptions=False)
|
||||||
|
except:
|
||||||
|
return HttpResponseServerError
|
||||||
|
|
||||||
if cached_doc:
|
if cached_doc:
|
||||||
return HttpResponse(cached_doc.body, mimetype='text/xml')
|
return HttpResponse(cached_doc.body, mimetype='text/xml')
|
||||||
|
|||||||
Reference in New Issue
Block a user