aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-04-17 15:59:46 +0300
committerBonfaceKilz2024-04-30 13:09:46 +0300
commit86935283cbf1dfe5094756042f6138ec9ab1e4b4 (patch)
treed11196bf0d7e7e03b457103bcfd42272299b47e5
parent8aee04b702a947579202d00540d262b1be1e68d5 (diff)
downloadgenenetwork2-86935283cbf1dfe5094756042f6138ec9ab1e4b4.tar.gz
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 <me@bonfacemunyoki.com>
-rw-r--r--gn2/wqflask/edit.py38
1 files changed, 0 insertions, 38 deletions
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_ = "<tr><td><i>%cr</i></td>\
-<td>\
-<a style='color:green;' href='https://git.genenetwork.org/gn-docs/commit/general?id=%H' \
-target='_blank'>%h</a></td>\
-<td>%s</td><td>%an</td></tr>"
- args = [
- "git", "-C", str(dataset_path), "log",
- f"--pretty=format:{format_}"
- ]
- results = __run_cmd__(
- args
- )
- return results
-
-
-@metadata.route("<id_>/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()
- )