From 966cdc824a02c7a065e5d4129c01385cd4bf075e Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Fri, 7 May 2021 16:53:41 +0200 Subject: [PATCH] remove validity check of result files for now --- web/app/corpora/views.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/web/app/corpora/views.py b/web/app/corpora/views.py index 46bb4aea..2e740cd6 100644 --- a/web/app/corpora/views.py +++ b/web/app/corpora/views.py @@ -342,16 +342,16 @@ def add_query_result(): 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 - schema = json.load(file) - try: - # validate imported json file - validate(instance=query_result_file_content, schema=schema) - except Exception: - tasks.delete_query_result(query_result.id) - flash('Uploaded file is invalid', 'result') - return make_response( - {'redirect_url': url_for('.add_query_result')}, 201) + # with open('app/static/json_schema/nopaque_cqi_py_results_schema.json', 'r') as file: # noqa + # schema = json.load(file) + # try: + # # validate imported json file + # validate(instance=query_result_file_content, schema=schema) + # except Exception: + # tasks.delete_query_result(query_result.id) + # flash('Uploaded file is invalid', 'result') + # return make_response( + # {'redirect_url': url_for('.add_query_result')}, 201) query_result_file_content.pop('matches') query_result_file_content.pop('cpos_lookup') query_result.query_metadata = query_result_file_content