Skip to content

Commit

Permalink
Fix bug where incorrect redirect path is used
Browse files Browse the repository at this point in the history
  • Loading branch information
malchua committed Feb 6, 2025
1 parent 00926c0 commit e33bb9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/data_exports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,16 @@ def redirect_to_project
redirect_to namespace_project_path(project.parent, project)
end

def redirect_to_workflow_execution
def redirect_to_workflow_execution # rubocop:disable Metrics/AbcSize
workflow_execution = WorkflowExecution.find_by(id: params['identifier'])
submitter = workflow_execution.submitter
if submitter.user_type == 'human'
redirect_to workflow_execution_path(workflow_execution)
if workflow_execution.submitter == current_user
redirect_to workflow_execution_path(workflow_execution)
else
namespace = workflow_execution.namespace
redirect_to namespace_project_workflow_execution_path(namespace.parent, namespace.project, workflow_execution)
end
else
namespace = Namespace.find_by(puid: submitter.first_name)
redirect_to namespace_project_workflow_execution_path(namespace.parent, namespace.project, workflow_execution)
Expand Down

0 comments on commit e33bb9a

Please sign in to comment.