Unverified Commit 0f77df79 authored by mvdbeek's avatar mvdbeek
Browse files

Fix extract workflow from history with empty mapped over collections

Fixes https://github.com/galaxyproject/galaxy/issues/18484.

It's not ideal on the one hand, but better to have a workflow with gaps
than an internal server error IMO. We do the same for datasets in some
non-terminal states.
parent 5ae13639
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -320,6 +320,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
            # Optionally target a different history than the current one.
            history = self.history_manager.get_owned(self.decode_id(history_id), trans.user, current_history=history)
        if not user:
            trans.response.status = 403
            return trans.show_error_message("Must be logged in to create workflows")
        if (job_ids is None and dataset_ids is None) or workflow_name is None:
            jobs, warnings = summarize(trans, history)
+9 −1
Original line number Diff line number Diff line
@@ -321,7 +321,15 @@ class WorkflowSummary:
        # tracking with creating_job_associations. Will delete at some point.
        elif dataset_collection.implicit_output_name:
            # TODO: Optimize db call
            dataset_instance = dataset_collection.collection.dataset_instances[0]
            element = dataset_collection.collection.first_dataset_element
            if not element:
                # Got no dataset instance to walk back up to creating job.
                # TODO track this via tool request model
                job = DatasetCollectionCreationJob(dataset_collection)
                self.jobs[job] = [(None, dataset_collection)]
                return
            else:
                dataset_instance = element.hda
            if not self.__check_state(dataset_instance):
                # Just checking the state of one instance, don't need more but
                # makes me wonder if even need this check at all?