aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2021-11-04 11:56:34 +0300
committerBonfaceKilz2021-11-04 15:22:41 +0300
commit6633a39a54d7f1a66ee6671b37100f22388ccfab (patch)
treea4b87229b362ea8adf7244d506af50958b449803
parent512200976ff5330c0716c4f2278745449ed52908 (diff)
downloadgenenetwork2-6633a39a54d7f1a66ee6671b37100f22388ccfab.tar.gz
Remove variables that are only used once
-rw-r--r--wqflask/wqflask/metadata_edits.py6
1 files 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'))