Skip to content

Commit

Permalink
Fix delete request, fix error triggered by attempting invalid convers…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
guerler committed Mar 16, 2017
1 parent 689560d commit 06f6192
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/user/user-custom-builds.js
Expand Up @@ -41,7 +41,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/form/form-view', 'mvc/ui/ui-tabl
icon : 'fa-trash-o',
cls : 'ui-button-icon-plain',
tooltip : 'Delete custom build.',
onclick : function() { alert( model.id ); }
onclick : function() { model.destroy() }
} ) ).$el );
self.table.append( model.id );
});
Expand Down
29 changes: 16 additions & 13 deletions lib/galaxy/webapps/galaxy/api/users.py
Expand Up @@ -652,19 +652,22 @@ def get_custom_builds(self, trans, id, payload={}, **kwd):
for key, attributes in dbkeys.items():
if 'count' not in attributes:
fasta_dataset = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( attributes[ 'fasta' ] )
len_dataset = fasta_dataset.get_converted_dataset( trans, "len" )
# HACK: need to request dataset again b/c get_converted_dataset()
# doesn't return dataset (as it probably should).
len_dataset = fasta_dataset.get_converted_dataset( trans, "len" )
if len_dataset.state != trans.app.model.Job.states.ERROR:
chrom_count_dataset = len_dataset.get_converted_dataset( trans, "linecount" )
if chrom_count_dataset and chrom_count_dataset.state == trans.app.model.Job.states.OK:
try:
chrom_count = int( open( chrom_count_dataset.file_name ).readline() )
attributes[ 'count' ] = chrom_count
updated = True
except Exception as e:
raise MessageException('Failed to open chrom count dataset: %s.' % e)
try:
len_dataset = fasta_dataset.get_converted_dataset( trans, "len" )
# HACK: need to request dataset again b/c get_converted_dataset()
# doesn't return dataset (as it probably should).
len_dataset = fasta_dataset.get_converted_dataset( trans, "len" )
if len_dataset.state != trans.app.model.Job.states.ERROR:
chrom_count_dataset = len_dataset.get_converted_dataset( trans, "linecount" )
if chrom_count_dataset and chrom_count_dataset.state == trans.app.model.Job.states.OK:
try:
chrom_count = int( open( chrom_count_dataset.file_name ).readline() )
attributes[ 'count' ] = chrom_count
updated = True
except Exception as e:
pass
except Exception as e:
pass
if updated:
user.preferences['dbkeys'] = json.dumps(dbkeys)
trans.sa_session.flush()
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/buildapp.py
Expand Up @@ -573,7 +573,7 @@ def populate_api_routes( webapp, app ):
conditions=dict( method=["PUT"] ) )

webapp.mapper.connect( 'delete_custom_builds',
'/api/users/{id}/custom_builds',
'/api/users/{id}/custom_builds/{key}',
controller='users',
action='delete_custom_builds',
conditions=dict( method=["DELETE"] ) )
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/user/user-custom-builds.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/mvc/user/user-custom-builds.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 06f6192

Please sign in to comment.