Skip to content

Commit

Permalink
#832 uploading zip for benchmark (upload failed)
Browse files Browse the repository at this point in the history
  • Loading branch information
mellelieuwes committed Jun 6, 2024
1 parent 9603965 commit ea0bc7b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 1 addition & 2 deletions core/systems/assignment/_director.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ defmodule Systems.Assignment.Director do
def authorization_context(tool, user) do
{member, _} = search_subject(tool, user)

tool_ref = Workflow.Public.get_tool_ref_by_tool(tool)
item = Workflow.Public.get_item_by_tool_ref(tool_ref)
item = Workflow.Public.get_item_by_tool(tool)
assignment = Assignment.Public.get_by_tool(tool)

task =
Expand Down
2 changes: 1 addition & 1 deletion core/systems/workflow/_public.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule Systems.Workflow.Public do
|> Repo.get!(id)
end

def get_tool_ref_by_tool(%{id: id} = tool, preload \\ []) do
def get_item_by_tool(%{id: id} = tool, preload \\ []) do
field = Workflow.ToolRefModel.tool_id_field(tool)
get_item_by_tool!(field, id, preload)
end
Expand Down
17 changes: 16 additions & 1 deletion core/systems/workflow/_switch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,25 @@ defmodule Systems.Workflow.Switch do
alias Frameworks.Signal
alias Systems.Workflow

@impl true
def intercept(
{:instruction_tool, _} = signal,
%{instruction_tool: tool} = message
) do
workflow_item = Workflow.Public.get_item_by_tool(tool, [:workflow, :tool_ref])

dispatch!(
{:workflow_item, signal},
Map.merge(message, %{workflow_item: workflow_item})
)

:ok
end

@impl true
def intercept(
{:tool_ref, _} = signal,
%{tool_ref: %Workflow.ToolRefModel{} = tool_ref} = message
%{tool_ref: tool_ref} = message
) do
workflow_item = Workflow.Public.get_item_by_tool_ref(tool_ref, [:workflow, :tool_ref])

Expand Down

0 comments on commit ea0bc7b

Please sign in to comment.