Skip to content

Commit

Permalink
[DRH-131] Fix seek4science#1581 template upload issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
reutenauer committed Sep 11, 2023
1 parent 46f112a commit 42316cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/controllers/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def task_status

def populate_template
uploaded_file = params[:template_json_file]
dir = Rails.root.join('config', 'default_data', 'source_types')
dir = Rails.root.join('filestore', 'source_types')

if Dir.exist?(dir)
`rm #{dir}/*`
Expand Down Expand Up @@ -146,11 +146,11 @@ def set_status
end

def lockfile
Rails.root.join('tmp', 'populate_templates.lock')
Rails.root.join('tmp', 'cache', 'populate_templates.lock')
end

def resultfile
Rails.root.join('tmp', 'populate_templates.result')
Rails.root.join('tmp', 'cache', 'populate_templates.result')
end

def running!
Expand Down
6 changes: 3 additions & 3 deletions lib/seek/isa_templates/template_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def self.extract_templates
disable_authorization_checks do
client = Ebi::OlsClient.new
project = Project.find_or_create_by(title: 'Default Project')
directory = Rails.root.join('config', 'default_data', 'source_types')
directory = Rails.root.join('filestore', 'source_types')
directory_files = Dir.exist?(directory) ? Dir.glob("#{directory}/*.json") : []
raise '<ul><li>Make sure to upload files that have the ".json" extension.</li></ul>' if directory_files == []

Expand Down Expand Up @@ -172,11 +172,11 @@ def self.seed_isa_tags
end

def self.lockfile
Rails.root.join('tmp', 'populate_templates.lock')
Rails.root.join('tmp', 'cache', 'populate_templates.lock')
end

def self.resultfile
Rails.root.join('tmp', 'populate_templates.result')
Rails.root.join('tmp', 'cache', 'populate_templates.result')
end
end
end
Expand Down

0 comments on commit 42316cc

Please sign in to comment.