From 8bfb79da9b8dc0591532939dca97e0fa9c06c5d2 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 26 Jun 2023 08:49:39 +0300 Subject: Bug: Pass dataset name for 'Publish' data The dataset name is needed for authorisation checks. --- wqflask/wqflask/metadata_edits.py | 5 ++++- wqflask/wqflask/templates/edit_phenotype.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index d24a3098..59cc3083 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -149,7 +149,7 @@ def display_phenotype_metadata(dataset_id: str, name: str): name=name, resource_id=request.args.get("resource-id"), version=os.environ.get("GN_VERSION"), - ) + dataset_name=request.args["dataset_name"]) @metadata_edit.route("/traits/") @@ -242,6 +242,7 @@ def update_phenotype(dataset_id: str, name: str): return redirect( f"/datasets/{dataset_id}/traits/{name}" f"?resource-id={request.args.get('resource-id')}" + f"&dataset_name={request.args['dataset_name']}" ) # Edge case where the csv file has not been edited! if not any(diff_data.values()): @@ -251,6 +252,7 @@ def update_phenotype(dataset_id: str, name: str): return redirect( f"/datasets/{dataset_id}/traits/{name}" f"?resource-id={request.args.get('resource-id')}" + f"&dataset_name={request.args['dataset_name']}" ) with open( @@ -391,6 +393,7 @@ View the diffs here", "success") return redirect( f"/datasets/{dataset_id}/traits/{name}" f"?resource-id={request.args.get('resource-id')}" + f"&dataset_name={request.args['dataset_name']}" ) diff --git a/wqflask/wqflask/templates/edit_phenotype.html b/wqflask/wqflask/templates/edit_phenotype.html index d67468c3..813947d6 100644 --- a/wqflask/wqflask/templates/edit_phenotype.html +++ b/wqflask/wqflask/templates/edit_phenotype.html @@ -17,7 +17,7 @@ [View History] -
+
-- cgit v1.2.3