aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uploader/phenotypes/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index 04264c2..e958c7a 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -231,6 +231,11 @@ def view_phenotype(# pylint: disable=[unused-argument]
population["Id"],
dataset["Id"],
xref_id)
+ def __non_empty__(value) -> bool:
+ if isinstance(value, str):
+ return value.strip() != ""
+ return bool(value)
+
return render_template(
"phenotypes/view-phenotype.html",
species=species,
@@ -244,8 +249,7 @@ def view_phenotype(# pylint: disable=[unused-argument]
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() != "")
+ and __non_empty__(val))
},
privileges=(privileges
### For demo! Do not commit this part