def data_upload_progress(req):
 if ('id' in req.GET):
  upload_id = str(req.GET['id'])
  if (upload_id in req.session):
   upload_obj = get_object_or_404(Upload, import_id=upload_id, user=req.user)
   upload_session = upload_obj.get_session()
  else:
   upload_session = req.session[upload_id]
  import_session = upload_session.import_session
  progress = import_session.tasks[0].get_progress()
  return json_response(progress)
 else:
  return json_response({'state': 'NONE'})

def data_upload_progress ( req ) : if ( 'id' in req . GET ) : upload_id = str ( req . GET [ 'id' ] ) if ( upload_id in req . session ) : upload_obj = get_object_or_404 ( Upload , import_id = upload_id , user = req . user ) upload_session = upload_obj . get_session ( ) else : upload_session = req . session [ upload_id ] import_session = upload_session . import_session progress = import_session . tasks [ 0 ] . get_progress ( ) return json_response ( progress ) else : return json_response ( { 'state' : 'NONE' } )
this would not be needed if geoserver rest did not require admin role and is an inefficient way of getting this information .