From 79d6dc5ac4610ea50e61bca80598b87d42911490 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 2 Aug 2021 21:24:39 +0300 Subject: wqflask: views: Add dataset_id to diff json that'll be stored --- wqflask/wqflask/views.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index ed5398a2..11e1bfaa 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -593,10 +593,13 @@ def update_phenotype(): f"{phenotype_id}.{current_time}.json") with open(diff_output, "w") as f: dict_ = json.loads(r.get("output")) - dict_.update({"author": author.decode('utf-8')}) - dict_.update({"publishdata_id": publishdata_id}) - dict_.update({"timestamp": datetime.datetime.now().strftime( - "%Y-%m-%d %H:%M:%S")}) + dict_.update({ + "author": author.decode('utf-8'), + "publishdata_id": publishdata_id, + "dataset_id": data_.get("dataset-name"), + "timestamp": datetime.datetime.now().strftime( + "%Y-%m-%d %H:%M:%S") + }) f.write(json.dumps(dict_)) flash("Sample-data has been successfully uploaded", "success") # Run updates: -- cgit v1.2.3