From 328ff82e449f88089025576e7d703a704cb90276 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 15 Mar 2023 00:50:51 +0000 Subject: Fix bug caused by RRIDs parseable as ints --- wqflask/wqflask/show_trait/SampleList.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py index e7fbc19b..44b89671 100644 --- a/wqflask/wqflask/show_trait/SampleList.py +++ b/wqflask/wqflask/show_trait/SampleList.py @@ -71,20 +71,19 @@ class SampleList: # Add a url so RRID case attributes can be displayed as links if '36' in sample.extra_attributes: + rrid_string = str(sample.extra_attributes['36']) if self.dataset.group.species == "mouse": - if len(sample.extra_attributes['36'].split(":")) > 1: - the_rrid = sample.extra_attributes['36'].split(":")[ - 1] + if len(rrid_string.split(":")) > 1: + the_rrid = rrid_string.split(":")[1] sample.extra_attributes['36'] = [ - sample.extra_attributes['36']] + rrid_string] sample.extra_attributes['36'].append( webqtlConfig.RRID_MOUSE_URL % the_rrid) elif self.dataset.group.species == "rat": - if len(str(sample.extra_attributes['36'])): - the_rrid = sample.extra_attributes['36'].split("_")[ - 1] + if len(rrid_string): + the_rrid = rrid_string.split("_")[1] sample.extra_attributes['36'] = [ - sample.extra_attributes['36']] + rrid_string] sample.extra_attributes['36'].append( webqtlConfig.RRID_RAT_URL % the_rrid) -- cgit v1.2.3