From fb0ca34547f2b804154e4c0d554cd383c96cce42 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 2 Mar 2022 15:54:48 +0300 Subject: Use updated `delete_sample_data` from gn3 --- wqflask/wqflask/metadata_edits.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index 24cbd3d1..c9af0467 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -544,18 +544,19 @@ def approve_data(resource_id:str, file_name: str): "changes could be applied."), "warning") n_deletions = 0 - for deletion in (deletions := [d for d in sample_data.get("Deletions")]): - strain_name, _, _, _ = deletion.split(",") - __deletions, _, _ = delete_sample_data( + for data in [d for d in sample_data.get("Deletions")]: + __deletions = delete_sample_data( conn=conn, trait_name=sample_data.get("trait_name"), - strain_name=strain_name, + data=data, + csv_header=sample_data.get("Columns", + "Strain Name,Value,SE,Count"), phenotype_id=int(sample_data.get("phenotype_id"))) if __deletions: n_deletions += 1 # Remove any data that already exists from sample_data deletes else: - sample_data.get("Deletions").remove(deletion) + sample_data.get("Deletions").remove(data) n_insertions = 0 for data in [d for d in sample_data.get("Additions")]: -- cgit v1.2.3