Changeset 1595:56bc2f789894

Show
Ignore:
Timestamp:
11/01/08 15:30:13 (2 months ago)
Author:
Greg Von Kuster <greg@bx.psu.edu>
branch:
default
Message:

Fix History.add_dataset() to be compatible with sqlalchemy 4.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/galaxy/model/__init__.py

    r1591 r1595  
    354354            dataset.flush() 
    355355        elif not isinstance( dataset, HistoryDatasetAssociation ): 
    356             raise TypeError, "You can only add Dataset and HistoryDatasetAssociation instances to a history." 
     356            raise TypeError, "You can only add Dataset and HistoryDatasetAssociation instances to a history ( you tried to add %s )." % str( dataset ) 
    357357        if parent_id: 
    358358            for data in self.datasets: 
     
    361361                    break 
    362362            else: 
    363                 if set_hid: dataset.hid = self._next_hid() 
    364         else: 
    365             if set_hid: dataset.hid = self._next_hid() 
    366         dataset.history = self 
     363                if set_hid: 
     364                    dataset.hid = self._next_hid() 
     365        else: 
     366            if set_hid: 
     367                dataset.hid = self._next_hid() 
    367368        if genome_build not in [None, '?']: 
    368369            self.genome_build = genome_build