From e781140ff10f41284dbfc6aaac49f1f3183dbffd Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 15 Feb 2024 18:09:47 +0100 Subject: [PATCH] Fix succces typo --- lib/galaxy/celery/tasks.py | 2 +- lib/galaxy/jobs/__init__.py | 2 +- lib/galaxy/model/__init__.py | 4 ++-- lib/galaxy/tools/__init__.py | 2 +- lib/galaxy/webapps/galaxy/controllers/dataset.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/celery/tasks.py b/lib/galaxy/celery/tasks.py index b29b67981ba2..4b3785012d56 100644 --- a/lib/galaxy/celery/tasks.py +++ b/lib/galaxy/celery/tasks.py @@ -198,7 +198,7 @@ def set_metadata( dataset_instance.datatype.set_meta(dataset_instance) dataset_instance.set_peek() # Reset SETTING_METADATA state so the dataset instance getter picks the dataset state - dataset_instance.set_metadata_succces_state() + dataset_instance.set_metadata_success_state() except Exception as e: log.info(f"Setting metadata failed on {model_class} {dataset_instance.id}: {str(e)}") dataset_instance.state = dataset_instance.states.FAILED_METADATA diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index cdac9e74e4cf..161397a5fa54 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1769,7 +1769,7 @@ def _finish_dataset(self, output_name, dataset, job, context, final_job_state, r ) if not metadata_set_successfully: if self.tool.tool_type == "expression": - dataset.set_metadata_succces_state() + dataset.set_metadata_success_state() elif retry_internally: # If Galaxy was expected to sniff type and didn't - do so. if dataset.ext == "_sniff_": diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 959da9f8e5b2..057349776a98 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -4409,13 +4409,13 @@ def state(self, state: Optional[DatasetState]): if state in (DatasetState.FAILED_METADATA, DatasetState.SETTING_METADATA): self._state = state else: - self.set_metadata_succces_state() + self.set_metadata_success_state() sa_session = object_session(self) if sa_session: sa_session.add(self.dataset) self.dataset.state = state - def set_metadata_succces_state(self): + def set_metadata_success_state(self): self._state = None def get_file_name(self, sync_cache=True) -> str: diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 00da6339aa2a..9ee57f84c6b2 100644 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -3033,7 +3033,7 @@ def exec_after_process(self, app, inp_data, out_data, param_dict, job=None, **kw dataset.state = param_dict.get("__ORIGINAL_DATASET_STATE__") else: # Revert dataset.state to fall back to dataset.dataset.state - dataset.set_metadata_succces_state() + dataset.set_metadata_success_state() # Need to reset the peek, which may rely on metadata # TODO: move this into metadata setting, setting the peek requires dataset access, # and large chunks of the dataset may be read here. diff --git a/lib/galaxy/webapps/galaxy/controllers/dataset.py b/lib/galaxy/webapps/galaxy/controllers/dataset.py index d74c3f17f8ee..07d1e09bbec7 100644 --- a/lib/galaxy/webapps/galaxy/controllers/dataset.py +++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py @@ -361,8 +361,8 @@ def set_edit(self, trans, payload=None, **kwd): annotation = sanitize_html(payload.get("annotation")) self.add_item_annotation(trans.sa_session, trans.get_user(), data, annotation) # if setting metadata previously failed and all required elements have now been set, clear the failed state. - if data._state == trans.model.Dataset.states.FAILED_METADATA and not data.missing_meta(): - data._state = None + if data.state == trans.model.Dataset.states.FAILED_METADATA and not data.missing_meta(): + data.set_metadata_success_state() message = f"Attributes updated. {message}" if message else "Attributes updated." else: message = "Attributes updated, but metadata could not be changed because this dataset is currently being used as input or output. You must cancel or wait for these jobs to complete before changing metadata."