Define the unicode() function for HTSUser to also report the users full name.
authorDiane Trout <diane@caltech.edu>
Tue, 15 Dec 2009 23:42:22 +0000 (23:42 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 15 Dec 2009 23:42:22 +0000 (23:42 +0000)
ticket:149
Make adding a user to an affiliation optional
ticket:150

htsworkflow/frontend/samples/models.py
htsworkflow/frontend/samples/views.py

index a5b3327047dab5faf5cbcb08668a3135a1fee020..cda52a308f994fe673dd65b73f4ad94b0bc8c1ea 100644 (file)
@@ -104,7 +104,7 @@ class Affiliation(models.Model):
   name = models.CharField(max_length=256, db_index=True, verbose_name='Name')
   contact = models.CharField(max_length=256, null=True, blank=True,verbose_name='Lab Name')  
   email = models.EmailField(null=True,blank=True)
-  users = models.ManyToManyField('HTSUser', null=True)
+  users = models.ManyToManyField('HTSUser', null=True, blank=True)
   users.admin_order_field = "username"
   
   def __unicode__(self):
@@ -275,6 +275,9 @@ class HTSUser(User):
 
     def admin_url(self):
         return '/admin/%s/%s/%d' % (self._meta.app_label, self._meta.module_name, self.id)
+
+    def __unicode__(self):
+        return unicode(self.username) + u" (" + unicode(self.get_full_name()) + u")"
     
 def HTSUserInsertID(sender, instance, **kwargs):
     """
index 20c3d98bd5171821dedc8e535eccab73b101b2dd..a14b22ccb6a92c7983d52ea0cfc0967ab26b901e 100644 (file)
@@ -382,6 +382,7 @@ def _make_eland_results(flowcell_id, lane, interesting_flowcells):
         result_path = cur_fc[cycle]['eland_results'].get(lane, None)
         result_link = make_result_link(fc_id, cycle, lane, result_path)
         results.append({'flowcell_id': fc_id,
+                        'run_date': flowcell.run_date,
                         'cycle': cycle, 
                         'lane': lane, 
                         'summary_url': make_summary_url(flowcell_id, cycle),