remove validity check of result files for now

This commit is contained in:
Patrick Jentsch 2021-05-07 16:53:41 +02:00
parent 2d0f6f50f8
commit 966cdc824a

View File

@ -342,16 +342,16 @@ def add_query_result():
with open(query_result.path, 'r') as file: with open(query_result.path, 'r') as file:
query_result_file_content = json.load(file) query_result_file_content = json.load(file)
# parse json schema # parse json schema
with open('app/static/json_schema/nopaque_cqi_py_results_schema.json', 'r') as file: # noqa # with open('app/static/json_schema/nopaque_cqi_py_results_schema.json', 'r') as file: # noqa
schema = json.load(file) # schema = json.load(file)
try: # try:
# validate imported json file # # validate imported json file
validate(instance=query_result_file_content, schema=schema) # validate(instance=query_result_file_content, schema=schema)
except Exception: # except Exception:
tasks.delete_query_result(query_result.id) # tasks.delete_query_result(query_result.id)
flash('Uploaded file is invalid', 'result') # flash('Uploaded file is invalid', 'result')
return make_response( # return make_response(
{'redirect_url': url_for('.add_query_result')}, 201) # {'redirect_url': url_for('.add_query_result')}, 201)
query_result_file_content.pop('matches') query_result_file_content.pop('matches')
query_result_file_content.pop('cpos_lookup') query_result_file_content.pop('cpos_lookup')
query_result.query_metadata = query_result_file_content query_result.query_metadata = query_result_file_content