def map_download_check(request):
 try:
  layer = request.session['map_status']
  if isinstance(layer, dict):
   url = ('%srest/process/batchDownload/status/%s' % (ogc_server_settings.LOCATION, layer['id']))
   (resp, content) = http_client.request(url, 'GET')
   status = resp.status
   if (resp.status == 400):
    return HttpResponse(content='Something went wrong', status=status)
  else:
   content = 'Something Went wrong'
   status = 400
 except ValueError:
  logger.warn('User tried to check status, but has no download in progress.')
 return HttpResponse(content=content, status=status)

def map_download_check ( request ) : try : layer = request . session [ 'map_status' ] if isinstance ( layer , dict ) : url = ( '%srest/process/batchDownload/status/%s' % ( ogc_server_settings . LOCATION , layer [ 'id' ] ) ) ( resp , content ) = http_client . request ( url , 'GET' ) status = resp . status if ( resp . status == 400 ) : return HttpResponse ( content = 'Something went wrong' , status = status ) else : content = 'Something Went wrong' status = 400 except ValueError : logger . warn ( 'User tried to check status, but has no download in progress.' ) return HttpResponse ( content = content , status = status )
this is an endpoint for monitoring map downloads .