Skip to content

Commit

Permalink
Allow deferring 'to_ext' extension to the server, implement for colle…
Browse files Browse the repository at this point in the history
…ctions.
  • Loading branch information
dannon committed Nov 1, 2018
1 parent 4c7ba6f commit 69b4471
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/galaxy/scripts/mvc/collection/collection-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend(
),

_downloadQueryParameters: function() {
var fileExt = this.get("file_ext");
// Setting the file extension to just 'data' defers that
// decision to the serverside, setting based on the datatype.
var fileExt = this.get("file_ext") || "data";
var elementIdentifier = this.get("element_identifier");
var parentHdcaId = this.get("parent_hdca_id");
return `?to_ext=${fileExt}&hdca_id=${parentHdcaId}&element_identifier=${elementIdentifier}`;
Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy/datatypes/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ def _download_filename(self, dataset, to_ext, hdca=None, element_identifier=None
def escape(raw_identifier):
return ''.join(c in FILENAME_VALID_CHARS and c or '_' for c in raw_identifier)[0:150]

if not to_ext:
if not to_ext or to_ext == "data":
# If a client requests to_ext with the extension 'data', they are
# deferring to the server, set it based on datatype.
to_ext = dataset.extension

template_values = {
Expand Down

0 comments on commit 69b4471

Please sign in to comment.