From 263311635bd820c0853846e92e84fae6aff37680 Mon Sep 17 00:00:00 2001
From: Loraine Gueguen <loraine.gueguen@sb-roscoff.fr>
Date: Thu, 20 May 2021 22:40:52 +0200
Subject: [PATCH] fix picture_path in species template

---
 templates/gspecies_compose.yml.j2 | 2 +-
 utilities.py                      | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/templates/gspecies_compose.yml.j2 b/templates/gspecies_compose.yml.j2
index 1b1e8f8..82bb8ee 100644
--- a/templates/gspecies_compose.yml.j2
+++ b/templates/gspecies_compose.yml.j2
@@ -42,7 +42,7 @@ services:
             - ./banner.png:/var/www/html/banner.png:ro
             {% endif %}
             #- /groups/XXX/:/groups/XXX/:ro  # We do this when we have symlinks in src_data pointing to /groups/XXX/...
-            {% if 'picture_path' is defined %}
+            {% if 'picture_path' is defined and 'picture_path' != None %}
                 {% if 'png' in picture_path %}
             - ./species.png:/var/www/html/species.png:ro
                 {% endif %}
diff --git a/utilities.py b/utilities.py
index 42d4162..af7a5ea 100755
--- a/utilities.py
+++ b/utilities.py
@@ -179,11 +179,10 @@ def get_sp_picture(sp_dict_list):
         gspecies = get_gspecies_string_from_sp_dict(sp)
         if gspecies not in sp_picture_dict.keys() or ( constants.ORG_PARAM_DESC_MAIN_SPECIES in sp[constants.ORG_PARAM_DESC].keys() and
                                                            sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_MAIN_SPECIES] == True ):
-            sp_picture_dict[gspecies] = "" # default value
+            sp_picture_dict[gspecies] = ""
             if constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys() and \
                     sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != "":
                 sp_picture_dict[gspecies] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]
-    logging.debug("Species picture dictionary: {0}".format(sp_picture_dict))
     return sp_picture_dict
 
 def run_tool(instance, tool_id, history_id, tool_inputs):
-- 
GitLab