diff options
author | BonfaceKilz | 2021-08-02 21:46:07 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-08-03 15:49:50 +0300 |
commit | 366c9c433a0b18db25f5cb28d7c7dc1ed17b3c67 (patch) | |
tree | ccf731a8d2884f6c4d9a42b25b8128aa6ffbd9dd /wqflask | |
parent | 4594743baf6e6fd4b50f68665d009084f605bc78 (diff) | |
download | genenetwork2-366c9c433a0b18db25f5cb28d7c7dc1ed17b3c67.tar.gz |
Display a flash message after a file(and data) approval
squash! Display a flash message after a file(and data) approval
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/templates/display_files.html | 9 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/wqflask/wqflask/templates/display_files.html b/wqflask/wqflask/templates/display_files.html index 30974300..f8bc188f 100644 --- a/wqflask/wqflask/templates/display_files.html +++ b/wqflask/wqflask/templates/display_files.html @@ -2,6 +2,15 @@ {% block title %}Trait Submission{% endblock %} {% block content %} <!-- Start of body --> +{% with messages = get_flashed_messages(with_categories=true) %} +{% if messages %} +{% for category, message in messages %} +<div class="container-fluid bg-{{ category }}"> + <p>{{ message }}</p> +</div> +{% endfor %} +{% endif %} +{% endwith %} Show files for approval <div> diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index c7582782..11c8b347 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1414,12 +1414,13 @@ def approve_data(name): sample_data = json.load(myfile) PUBLISH_ID = sample_data.get("publishdata_id") modifications = [d for d in sample_data.get("Modifications")] + row_counts = len(modifications) for modification in modifications: if modification.get("Current"): (strain_id, strain_name, value, se, count) = modification.get("Current").split(",") - row_counts = update_sample_data( + update_sample_data( conn=conn, strain_name=strain_name, strain_id=int(strain_id), @@ -1439,6 +1440,9 @@ def approve_data(name): os.rename(os.path.join("/tmp/sample-data/diffs", name), os.path.join("/tmp/sample-data/diffs", f"{name}.approved")) + flash((f"Just updated data from: {name}; {row_counts} " + "row(s) modified!"), + "success") return redirect("/admin/data-sample/diffs/") |