about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBonfaceKilz2022-04-12 13:22:11 +0300
committerBonfaceKilz2022-04-12 13:30:04 +0300
commit47686b74aa4ca4f1dee5c7174b4f4dc54b1a1de8 (patch)
tree64411fdf0114167b311cec0711c6a584e74a39af
parent1fd9f2398760452cf6472e7cb78b68fafc9b27c2 (diff)
downloadgenenetwork2-47686b74aa4ca4f1dee5c7174b4f4dc54b1a1de8.tar.gz
Replace get_allowable_sampledata_headers with get_case_attributes
* wqflask/wqflask/metadata_edits.py: Remove
"get_allowable_sampledata_headers" import.
(display_phenotype_metadata): Use
"get_case_attributes" to fetch all the allowable
case attributes.
-rw-r--r--wqflask/wqflask/metadata_edits.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index ec6c9e7a..7fa0b310 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -29,7 +29,6 @@ from gn3.authentication import get_highest_user_access_role
 from gn3.csvcmp import create_dirs_if_not_exists
 from gn3.csvcmp import csv_diff
 from gn3.csvcmp import extract_invalid_csv_headers
-from gn3.csvcmp import get_allowable_sampledata_headers
 from gn3.csvcmp import remove_insignificant_edits
 from gn3.db import diff_from_dict
 from gn3.db import fetchall
@@ -208,7 +207,7 @@ def display_phenotype_metadata(dataset_id: str, name: str):
             publication=_d.get("publication"),
             dataset_id=dataset_id,
             resource_id=request.args.get("resource-id"),
-            headers=get_allowable_sampledata_headers(conn),
+            headers=get_case_attributes(conn).keys(),
             version=os.environ.get("GN_VERSION"),
         )
 
@@ -272,7 +271,6 @@ def update_phenotype(dataset_id: str, name: str):
                 ),
                 epsilon=0.001,
             )
-            headers = get_allowable_sampledata_headers(conn)
             invalid_headers = extract_invalid_csv_headers(
                 allowed_headers=headers, csv_text=delta_csv
             )
@@ -688,7 +686,6 @@ def show_case_attribute_columns():
     case_attributes = {}
     with database_connection() as conn:
         case_attributes = get_case_attributes(conn)
-
     for key, val in case_attributes.items():
         if not val:
             case_attributes[key] = "No description"