From ddeae95c9659d9daabb071132fdbd2ec35869e7a Mon Sep 17 00:00:00 2001 From: Greg Buchanan Date: Sun, 20 Oct 2024 23:46:19 -0400 Subject: [PATCH] Check for path in job name before finalizing it. --- .../app/lib/smart_attributes/attributes/auto_job_name.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/app/lib/smart_attributes/attributes/auto_job_name.rb b/apps/dashboard/app/lib/smart_attributes/attributes/auto_job_name.rb index 0761ec7a18..fa8b469989 100644 --- a/apps/dashboard/app/lib/smart_attributes/attributes/auto_job_name.rb +++ b/apps/dashboard/app/lib/smart_attributes/attributes/auto_job_name.rb @@ -37,12 +37,12 @@ def submit(*) # TODO: need to sanitize the job name for some schedulers def job_name(name) - [ + formatted_prefix = [ ENV['OOD_PORTAL'], # the OOD portal id ENV['RAILS_RELATIVE_URL_ROOT'].to_s.sub(%r{^/[^/]+/}, ''), # the OOD app - 'project-manager', - name # the user supplied job name + 'project-manager' ].reject(&:blank?).join('/') + name.include?(formatted_prefix) ? name : "#{formatted_prefix}/#{name}" end end end