From 86935283cbf1dfe5094756042f6138ec9ab1e4b4 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 17 Apr 2024 15:59:46 +0300 Subject: Remove methods for fetching a dataset's metadata edit history. * gn2/wqflask/edit.py (__fetch_dataset_git_history__): Delete (view_history): Delete. Signed-off-by: Munyoki Kilyungi --- gn2/wqflask/edit.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'gn2') diff --git a/gn2/wqflask/edit.py b/gn2/wqflask/edit.py index 964b2fdb..33772375 100644 --- a/gn2/wqflask/edit.py +++ b/gn2/wqflask/edit.py @@ -119,41 +119,3 @@ def save(): flash("Successfully updated data", "success") # Make a request to GN3 save endpoint return redirect(f"/datasets/{name}") - - -def __fetch_dataset_git_history__( - git_dir:str , dataset_name: str -) -> Either: - """Fetch the git history of a given dataset.""" - # Age, Commit, Message, Author - dataset_path = Path(git_dir) / "general/datasets/" / dataset_name - format_ = "%cr\ -\ -%h\ -%s%an" - args = [ - "git", "-C", str(dataset_path), "log", - f"--pretty=format:{format_}" - ] - results = __run_cmd__( - args - ) - return results - - -@metadata.route("/history") -def view_history(id_): - """View a datasets history""" - from gn2.utility.tools import get_setting - data = __fetch_dataset_git_history__( - Path(get_setting("DATA_DIR"), "gn-docs"), id_ - ).either( - lambda error: flash(f"{error=}", error), - lambda x: x - ) - return render_template( - "dataset_history.html", - name=request.args.get("name",""), - data=data.decode() - ) -- cgit v1.2.3