Unverified Commit 65824fc7 authored by mvdbeek's avatar mvdbeek
Browse files

Fix extracting workflows from purged and deleted histories

parent 94456cb7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3645,6 +3645,10 @@ class History(Base, HasTags, Dictifiable, UsesAnnotations, HasName, Serializable
        """Return all active contents ordered by hid."""
        return self.contents_iter(types=["dataset", "dataset_collection"], deleted=False, visible=True)

    @property
    def visible_contents(self):
        return self.contents_iter(types=["dataset", "dataset_collection"], visible=True)

    def contents_iter(self, **kwds):
        """
        Fetch filtered list of contents of history.
+1 −1
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ class WorkflowSummary:
        # just grab the implicitly mapped jobs and handle in second pass. Second pass is
        # needed because cannot allow selection of individual datasets from an implicit
        # mapping during extraction - you get the collection or nothing.
        for content in self.history.active_contents:
        for content in self.history.visible_contents:
            self.__summarize_content(content)

    def __summarize_content(self, content):
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ into a workflow will be shown in gray.</p>
    <div class="warningmark">${warning}</div>
%endfor

<form method="post" action="${h.url_for(controller='workflow', action='build_from_current_history')}">
<form method="post" action="${h.url_for(controller='workflow', action='build_from_current_history', history_id=trans.security.encode_id(history.id))}">
<div class='form-row'>
    <label>Workflow name</label>
    <input name="workflow_name" type="text" value="Workflow constructed from history '${ util.unicodify( history.name )}'" size="60"/>
+4 −0
Original line number Diff line number Diff line
@@ -121,6 +121,10 @@ class MockHistory:
    def active_contents(self):
        return self.active_datasets

    @property
    def visible_contents(self):
        return self.active_contents


class MockTrans:
    def __init__(self, history):