From de500f04eed142e9432ba4f77160be82d2a8930d Mon Sep 17 00:00:00 2001 From: Jordan <21129425+ItIsJordan@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:34:35 +0000 Subject: [PATCH] Remove the load_fail value in table_contents Removes the load_fail value in table_contents due to finding a better implementation. Table data existence is checked by length of "values" in table_data. --- hepdata/modules/records/assets/js/hepdata_tables.js | 3 +-- hepdata/modules/records/utils/data_processing_utils.py | 3 +-- hepdata/modules/records/views.py | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hepdata/modules/records/assets/js/hepdata_tables.js b/hepdata/modules/records/assets/js/hepdata_tables.js index 730b0aee..6f4934f7 100644 --- a/hepdata/modules/records/assets/js/hepdata_tables.js +++ b/hepdata/modules/records/assets/js/hepdata_tables.js @@ -103,8 +103,7 @@ HEPDATA.table_renderer = { $("#hepdata_table_loader").addClass("hidden"); $("#hepdata_table_content").removeClass("hidden"); - - if(table_data.load_fail) { + if(table_data.values.length == 0) { $("#hepdata_table_loader").addClass("hidden"); $("#hepdata_filesize_fail").removeClass("hidden"); $("#hep_table").addClass("hidden"); diff --git a/hepdata/modules/records/utils/data_processing_utils.py b/hepdata/modules/records/utils/data_processing_utils.py index 9beebbc3..64c1d827 100644 --- a/hepdata/modules/records/utils/data_processing_utils.py +++ b/hepdata/modules/records/utils/data_processing_utils.py @@ -216,8 +216,7 @@ def generate_table_structure(table_contents): "review": table_contents["review"], "associated_files": table_contents["associated_files"], "keywords": {}, - "values": [], - "load_fail": table_contents["load_fail"]} + "values": []} record["description"] = sanitize_html(table_contents["title"]) diff --git a/hepdata/modules/records/views.py b/hepdata/modules/records/views.py index 781baede..57dc8f58 100644 --- a/hepdata/modules/records/views.py +++ b/hepdata/modules/records/views.py @@ -333,7 +333,6 @@ def get_table_details(recid, data_recid, version, load_all): table_contents["dependent_variables"] = [] table_contents["independent_variables"] = [] - table_contents["load_fail"] = load_fail table_contents["name"] = datasub_record.name table_contents["title"] = datasub_record.description table_contents["keywords"] = datasub_record.keywords