Fix buf with manifests listing
This commit is contained in:
		@@ -1,8 +1,7 @@
 | 
				
			|||||||
[DEFAULT]
 | 
					[DEFAULT]
 | 
				
			||||||
# Address to bind the server to
 | 
					# Address to bind the server to
 | 
				
			||||||
host = 127.0.0.1
 | 
					host = 172.18.10.111
 | 
				
			||||||
 | 
					#Port the bind the server to
 | 
				
			||||||
# Port the bind the server to
 | 
					 | 
				
			||||||
port = 5000
 | 
					port = 5000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,16 +55,20 @@ def get_data_type_locations(data_type):
 | 
				
			|||||||
    ####### end validation ########
 | 
					    ####### end validation ########
 | 
				
			||||||
    if request.method == 'GET':
 | 
					    if request.method == 'GET':
 | 
				
			||||||
        locations = []
 | 
					        locations = []
 | 
				
			||||||
 | 
					        if data_type == MANIFEST:
 | 
				
			||||||
        for path, subdirs, files in os.walk(result_path):
 | 
					            for item in os.listdir(result_path):
 | 
				
			||||||
            for name in files:
 | 
					                if '-manifest' in item:
 | 
				
			||||||
                locations.append(name)
 | 
					                    locations.append(item)
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            for path, subdirs, files in os.walk(result_path):
 | 
				
			||||||
 | 
					                for name in files:
 | 
				
			||||||
 | 
					                    locations.append(name)
 | 
				
			||||||
        result = {data_type: locations}
 | 
					        result = {data_type: locations}
 | 
				
			||||||
        return jsonify(result)
 | 
					        return jsonify(result)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if request.method == 'POST':
 | 
					    if request.method == 'POST':
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            file_to_upload = request.files['files']
 | 
					            file_to_upload = request.files.get('files')
 | 
				
			||||||
            if file_to_upload:
 | 
					            if file_to_upload:
 | 
				
			||||||
                filename = secure_filename(file_to_upload.filename)
 | 
					                filename = secure_filename(file_to_upload.filename)
 | 
				
			||||||
                file_to_upload.save(os.path.join(result_path, filename))
 | 
					                file_to_upload.save(os.path.join(result_path, filename))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user