aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-03-20 15:57:43 +0300
committerBonfaceKilz2023-03-20 22:05:46 +0300
commitf7e627156ab3e4c172082ea7f19e5e4001ba5837 (patch)
tree8c8e282944a67343673f4549c20838299d900222 /wqflask
parente3aa54e44fcc990299bae846522fb92424260d01 (diff)
downloadgenenetwork2-f7e627156ab3e4c172082ea7f19e5e4001ba5837.tar.gz
Add link to diff page when sample-data is updated
* wqflask/wqflask/metadata_edits.py (update_phenotype): Add url to diff page in flash message. * wqflask/wqflask/templates/edit_phenotype.html: Render flash message with HTML.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/metadata_edits.py4
-rw-r--r--wqflask/wqflask/templates/edit_phenotype.html2
2 files changed, 4 insertions, 2 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index eb590408..730c2d44 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -250,7 +250,9 @@ def update_phenotype(dataset_id: str, name: str):
}
)
f.write(json.dumps(diff_data))
- flash("Sample-data has been successfully uploaded", "success")
+ url = url_for("metadata_edit.list_diffs")
+ flash(f"Sample-data has been successfully uploaded. \
+View the diffs <a href='{url}' target='_blank'>here</a>", "success")
# Run updates:
phenotype_ = {
"pre_pub_description": data_.get("pre-pub-desc"),
diff --git a/wqflask/wqflask/templates/edit_phenotype.html b/wqflask/wqflask/templates/edit_phenotype.html
index ea480f4e..cd4f2b60 100644
--- a/wqflask/wqflask/templates/edit_phenotype.html
+++ b/wqflask/wqflask/templates/edit_phenotype.html
@@ -6,7 +6,7 @@
{% if messages %}
{% for category, message in messages %}
<div class="container-fluid bg-{{ category }}">
- <p>{{ message }}</p>
+ <p>{{ message|safe }}</p>
</div>
{% endfor %}
{% endif %}