From: Diane Trout Date: Thu, 26 Feb 2009 05:21:52 +0000 (+0000) Subject: better handle the case when Affilations.contact is None X-Git-Tag: 0.2.0.1~14 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=8d3df7ec50ec9c5fba9d50bd5b8aaf77fd817b99 better handle the case when Affilations.contact is None --- diff --git a/htsworkflow/frontend/samples/admin.py b/htsworkflow/frontend/samples/admin.py index 9fb1408..00dea2a 100644 --- a/htsworkflow/frontend/samples/admin.py +++ b/htsworkflow/frontend/samples/admin.py @@ -36,7 +36,7 @@ class LibraryOptions(admin.ModelAdmin): #'cell_line', #'libtags', #'made_for', - 'affiliation', + 'affiliation', #'made_by', 'undiluted_concentration', 'creation_date', @@ -49,7 +49,7 @@ class LibraryOptions(admin.ModelAdmin): 'library_species', 'tags', #'made_for', - 'affiliations', + 'affiliations', 'made_by', 'antibody', 'cell_line', diff --git a/htsworkflow/frontend/samples/models.py b/htsworkflow/frontend/samples/models.py index 914cb00..8a5c31a 100644 --- a/htsworkflow/frontend/samples/models.py +++ b/htsworkflow/frontend/samples/models.py @@ -98,7 +98,7 @@ class Affiliation(models.Model): def __unicode__(self): str = unicode(self.name) - if len(self.contact) != 0: + if self.contact is not None and len(self.contact) > 0: str += u' ('+self.contact+u')' return str