about summary refs log tree commit diff
path: root/uploader/phenotypes
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-01-23 15:41:03 -0600
committerFrederick Muriuki Muriithi2025-01-23 15:41:03 -0600
commita7f4c053122a534218943ea778d875d3c1cc3ee6 (patch)
tree3e2ac9c7482e4c07c7f6292575596e4f5c70aff0 /uploader/phenotypes
parent7b626ecd21699bd809643aefeea7a075a96a4e66 (diff)
downloadgn-uploader-a7f4c053122a534218943ea778d875d3c1cc3ee6.tar.gz
Add publication data to page.
Diffstat (limited to 'uploader/phenotypes')
-rw-r--r--uploader/phenotypes/views.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index 9c5c71a..8ecd305 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -44,7 +44,8 @@ from .models import (dataset_by_id,
                      phenotypes_count,
                      save_new_dataset,
                      dataset_phenotypes,
-                     datasets_by_population)
+                     datasets_by_population,
+                     phenotype_publication_data)
 
 phenotypesbp = Blueprint("phenotypes", __name__)
 render_template = make_template_renderer("phenotypes")
@@ -232,6 +233,14 @@ def view_phenotype(# pylint: disable=[unused-argument]
             dataset=dataset,
             phenotype=phenotype,
             has_se=all(bool(item.get("error")) for item in phenotype["data"]),
+            publish_data={
+                key.replace("_", " "): val
+                for key,val in
+                (phenotype_publication_data(conn, phenotype["Id"]) or {}).items()
+                if (key in ("PubMed_ID", "Authors", "Title", "Journal")
+                    and val is not None
+                    and val.strip() is not "")
+            },
             privileges=(privileges
                         ### For demo! Do not commit this part
                             + ("group:resource:edit-resource",