From: Diane Trout Date: Mon, 7 Nov 2011 23:39:57 +0000 (-0800) Subject: Function generating index text was assuming there'd always be an index X-Git-Tag: v0.5.5~80 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=24da0614888d5b7f437b65823fbba793430ae00a Function generating index text was assuming there'd always be an index index_sequence was returning none for library adapter types that didnt support indexing. this caused my tests to fail for older libraries. --- diff --git a/htsworkflow/frontend/samples/models.py b/htsworkflow/frontend/samples/models.py index b81b122..2eeaaec 100644 --- a/htsworkflow/frontend/samples/models.py +++ b/htsworkflow/frontend/samples/models.py @@ -258,6 +258,9 @@ class Library(models.Model): def index_sequence_text(self, seperator=' '): """Return formatted multiplex index sequences""" sequences = self.index_sequences() + if sequences is None: + return "" + multiplex_ids = sequences.keys() multiplex_ids.sort() return seperator.join(( "%s:%s" %(i,sequences[i]) for i in multiplex_ids))