Skip to content

Commit

Permalink
Use sa_session of workcontext
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Jan 26, 2016
1 parent 5a72480 commit 7cc5050
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/galaxy/util/dbkeys.py
Expand Up @@ -33,7 +33,7 @@ def get_genome_build_names( self, trans=None ):
# It does allow one-off, history specific dbkeys to be created by a user. But we are not filtering,
# so a len file will be listed twice (as the build name and again as dataset name),
# if custom dbkey creation/conversion occurred within the current history.
datasets = self._app.model.context.query( self._app.model.HistoryDatasetAssociation ) \
datasets = trans.sa_session.query( self._app.model.HistoryDatasetAssociation ) \
.filter_by( deleted=False, history_id=trans.history.id, extension="len" )
for dataset in datasets:
rval.append( ( dataset.dbkey, "%s (%s) [History]" % ( dataset.name, dataset.dbkey ) ) )
Expand Down Expand Up @@ -72,11 +72,11 @@ def get_chrom_info( self, dbkey, trans=None, custom_build_hack_get_len_from_fast
# fasta-to-len converter.
if 'fasta' in custom_build_dict and custom_build_hack_get_len_from_fasta_conversion:
# Build is defined by fasta; get len file, which is obtained from converting fasta.
build_fasta_dataset = self._app.model.context.query( self._app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'fasta' ] )
build_fasta_dataset = trans.sa_session.query( self._app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'fasta' ] )
chrom_info = build_fasta_dataset.get_converted_dataset( trans, 'len' ).file_name
elif 'len' in custom_build_dict:
# Build is defined by len file, so use it.
chrom_info = self._app.model.context.query( self._app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'len' ] ).file_name
chrom_info = trans.sa_session.query( self._app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'len' ] ).file_name
# Check Data table
if not chrom_info:
dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
Expand Down

0 comments on commit 7cc5050

Please sign in to comment.