From 6633a39a54d7f1a66ee6671b37100f22388ccfab Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 4 Nov 2021 11:56:34 +0300 Subject: Remove variables that are only used once --- wqflask/wqflask/metadata_edits.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index 85bd9b08..bc24e92f 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -462,9 +462,7 @@ def approve_data(resource_id:str, file_name: str): with open(os.path.join(f"{TMPDIR}/sample-data/diffs", file_name), 'r') as myfile: sample_data = json.load(myfile) - PUBLISH_ID = sample_data.get("publishdata_id") modifications = [d for d in sample_data.get("Modifications")] - row_counts = len(modifications) for modification in modifications: if modification.get("Current"): (strain_id, @@ -474,7 +472,7 @@ def approve_data(resource_id:str, file_name: str): conn=conn, strain_name=strain_name, strain_id=int(strain_id), - publish_data_id=int(PUBLISH_ID), + publish_data_id=int(sample_data.get("publishdata_id")), value=value, error=se, count=count @@ -490,7 +488,7 @@ def approve_data(resource_id:str, file_name: str): os.rename(os.path.join(f"{TMPDIR}/sample-data/diffs", file_name), os.path.join(f"{TMPDIR}/sample-data/diffs", f"{file_name}.approved")) - flash((f"Just updated data from: {file_name}; {row_counts} " + flash((f"Just updated data from: {file_name}; {len(modifications)} " "row(s) modified!"), "success") return redirect(url_for('metadata_edit.list_diffs')) -- cgit v1.2.3