commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/32ea61c97ac8/ changeset: 32ea61c97ac8 user: dan date: 2012-10-11 18:28:21 summary: Add creating_job as a property to DatasetInstance. affected #: 1 file diff -r 05dfdda805908059de813a303e6ed02ea5e97117 -r 32ea61c97ac8472a781c9f4056c2044da0d06356 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -1261,6 +1261,18 @@ log.warning( e ) return lst return _source_dataset_chain( self, [] ) + @property + def creating_job( self ): + creating_job_associations = None + if self.creating_job_associations: + creating_job_associations = self.creating_job_associations + else: + inherit_chain = self.source_dataset_chain + if inherit_chain: + creating_job_associations = inherit_chain[-1][0].creating_job_associations + if creating_job_associations: + return creating_job_associations[0].job + return None def get_display_applications( self, trans ): return self.datatype.get_display_applications_by_dataset( self, trans ) https://bitbucket.org/galaxy/galaxy-central/changeset/046634d05007/ changeset: 046634d05007 user: dan date: 2012-10-11 18:28:21 summary: Have DatasetInstance controller use .creating_job property for call to _get_job_for_dataset(). affected #: 1 file diff -r 32ea61c97ac8472a781c9f4056c2044da0d06356 -r 046634d0500730333eb181399eaa097b1d9f4343 lib/galaxy/webapps/galaxy/controllers/dataset.py --- a/lib/galaxy/webapps/galaxy/controllers/dataset.py +++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py @@ -157,14 +157,11 @@ def _get_job_for_dataset( self, trans, dataset_id ): ''' Return the job for the given dataset. This will throw an error if the - dataset is either nonexistent or inaccessible to the user. This looks - up the job by mapping the dataset to an HDA and then mapping the HDA - to its job. This will throw exceptions so that the caller can determine - the appropriate response. + dataset is either nonexistent or inaccessible to the user. ''' hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( trans.security.decode_id( dataset_id ) ) assert hda and trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), hda.dataset ) - return hda.creating_job_associations[0].job + return hda.creating_job @web.expose def errors( self, trans, id ): Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket