Skip to content

Commit

Permalink
Merge pull request #1 from ScilifelabDataCentre/DRH-131-GitHub-1581-t…
Browse files Browse the repository at this point in the history
…emplate-upload-not-working

[DRH-131] Fix seek4science#1581 template upload issue.
  • Loading branch information
reutenauer authored Sep 11, 2023
2 parents 17946e0 + 42316cc commit c80eb0c
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 c80eb0c

Please sign in to comment.