Skip to content

Commit

Permalink
Set metadata states on dataset association, not dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Feb 14, 2024
1 parent 51c5705 commit 6d02125
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/model/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def handle_dataset_object_edit(dataset_instance, dataset_attrs):
dataset_instance.datatype.set_meta(dataset_instance)
except Exception:
log.debug(f"Metadata setting failed on {dataset_instance}", exc_info=True)
dataset_instance.dataset.state = dataset_instance.dataset.states.FAILED_METADATA
dataset_instance._state = dataset_instance.dataset.states.FAILED_METADATA

if model_class == "HistoryDatasetAssociation":
if not isinstance(dataset_instance, model.HistoryDatasetAssociation):
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/model/store/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def set_datasets_metadata(datasets, datasets_attributes=None):
primary_data.set_meta()
except Exception:
if primary_data.state == galaxy.model.HistoryDatasetAssociation.states.OK:
primary_data.state = galaxy.model.HistoryDatasetAssociation.states.FAILED_METADATA
primary_data._state = galaxy.model.HistoryDatasetAssociation.states.FAILED_METADATA
log.exception("Exception occured while setting metdata")

try:
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/services/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ def _change_item_datatype(
self.hda_manager.ensure_can_change_datatype(item)
self.hda_manager.ensure_can_set_metadata(item)
is_deferred = item.has_deferred_data
item.dataset.state = item.dataset.states.SETTING_METADATA
item._state = item.dataset.states.SETTING_METADATA
if is_deferred:
if params.datatype == "auto": # if `auto` just keep the original guessed datatype
item.update() # TODO: remove this `update` when we can properly track the operation results to notify the history
Expand Down

0 comments on commit 6d02125

Please sign in to comment.