diff options
-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/") |