From 7b626ecd21699bd809643aefeea7a075a96a4e66 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 23 Jan 2025 14:48:29 -0600 Subject: Only present SE and N columns if at least one row has them. --- uploader/phenotypes/views.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'uploader/phenotypes/views.py') diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index 53e68d1..9c5c71a 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -220,16 +220,18 @@ def view_phenotype(# pylint: disable=[unused-argument] ): """View an individual phenotype from the dataset.""" def __render__(privileges): + phenotype = phenotype_by_id(conn, + species["SpeciesId"], + population["Id"], + dataset["Id"], + xref_id) return render_template( "phenotypes/view-phenotype.html", species=species, population=population, dataset=dataset, - phenotype=phenotype_by_id(conn, - species["SpeciesId"], - population["Id"], - dataset["Id"], - xref_id), + phenotype=phenotype, + has_se=all(bool(item.get("error")) for item in phenotype["data"]), privileges=(privileges ### For demo! Do not commit this part + ("group:resource:edit-resource", -- cgit v1.2.3