app/views.py
def upload_endpoint():
    """
    Takes a document and stores it in the elasticsearch index
    """
    files = request.files.getlist('file[]')
    d = {}
    for f in files:
        sf = secure_filename(f.filename)

        es_dict = {
            'file': f.read().encode('base64'),
            'title': sf,
            'owner': 'blank'  # current_owner.organization.organization
        }
        es.index(index=es_index, doc_type='attachment', body=es_dict)
        f.close()

    return redirect(url_for('.root'))

    Takes a document and stores it in the elasticsearch index
    
Takes a document and stores it in the elasticsearch index
Takes a document and stores it in the elasticsearch index
def upload_endpoint():
    files = request.files.getlist('file[]')
    d = {}
    for f in files:
        sf = secure_filename(f.filename)
        es_dict = {
            'file': f.read().encode('base64'),
            'title': sf,
            'owner': 'blank'  
        }
        es.index(index=es_index, doc_type='attachment', body=es_dict)
        f.close()
    return redirect(url_for('.root'))
def upload_endpoint ( ) : files = request . files . getlist ( 'file[]' ) d = { } for f in files : sf = secure_filename ( f . filename ) es_dict = { 'file' : f . read ( ) . encode ( 'base64' ) , 'title' : sf , 'owner' : 'blank' } es . index ( index = es_index , doc_type = 'attachment' , body = es_dict ) f . close ( ) return redirect ( url_for ( '.root' ) )
Takes a document and stores it in the elasticsearch index
Takes a document and stores it in the elasticsearch index
"""
    Takes a document and stores it in the elasticsearch index
    """ # current_owner.organization.organization