better handle the case when Affilations.contact is None
authorDiane Trout <diane@caltech.edu>
Thu, 26 Feb 2009 05:21:52 +0000 (05:21 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 26 Feb 2009 05:21:52 +0000 (05:21 +0000)
htsworkflow/frontend/samples/admin.py
htsworkflow/frontend/samples/models.py

index 9fb140845423e6e061eb88f80754bf95089f35ed..00dea2a90e9d6cec1370318d35b8f95103055298 100644 (file)
@@ -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',
index 914cb006004167a622e93dd3ba03e0084c864c01..8a5c31a85efc83ee500b87b6e7413a14e4794ba0 100644 (file)
@@ -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