Function generating index text was assuming there'd always be an index
authorDiane Trout <diane@caltech.edu>
Mon, 7 Nov 2011 23:39:57 +0000 (15:39 -0800)
committerDiane Trout <diane@caltech.edu>
Mon, 7 Nov 2011 23:39:57 +0000 (15:39 -0800)
index_sequence was returning none for library adapter types that didnt
support indexing. this caused my tests to fail for older
libraries.

htsworkflow/frontend/samples/models.py

index b81b122111332c1b695541cfba3cef058f822a61..2eeaaecbe3b3aa9d3fc4c651e9774c70b6e4e383 100644 (file)
@@ -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))