mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-10-31 02:32:45 +00:00 
			
		
		
		
	fix query_result path logic
This commit is contained in:
		| @@ -336,7 +336,7 @@ def add_query_result(): | ||||
|         db.session.flush() | ||||
|         db.session.refresh(query_result) | ||||
|         try: | ||||
|             os.makedirs(query_result.path) | ||||
|             os.makedirs(os.path.dirname(query_result.path)) | ||||
|         except OSError: | ||||
|             logging.error('Make dir {} led to an OSError!'.format(query_result.path))  # noqa | ||||
|             db.session.rollback() | ||||
| @@ -344,11 +344,9 @@ def add_query_result(): | ||||
|             return make_response( | ||||
|                 {'redirect_url': url_for('.add_query_result')}, 500) | ||||
|         # save the uploaded file | ||||
|         query_result_file_path = os.path.join(query_result.path, | ||||
|                                               query_result.filename) | ||||
|         form.file.data.save(query_result_file_path) | ||||
|         form.file.data.save(query_result.path) | ||||
|         # parse json from file | ||||
|         with open(query_result_file_path, 'r') as file: | ||||
|         with open(query_result.path, 'r') as file: | ||||
|             query_result_file_content = json.load(file) | ||||
|         # parse json schema | ||||
|         with open('app/static/json_schema/nopaque_cqi_py_results_schema.json', 'r') as file:  # noqa | ||||
|   | ||||
		Reference in New Issue
	
	Block a user