diff options
author | James Lopez <james@jameslopez.es> | 2018-09-07 15:43:51 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-09-07 15:43:51 +0300 |
commit | f1277fbf0bbe8de330d5d80fdfe411a0c8571022 (patch) | |
tree | 8aa895e931eba976ccfa29867625759eb8441c4c /lib | |
parent | 27442862cf81881c81552e64d0b4d3354535c45e (diff) |
refactor code based on feedback
Diffstat (limited to 'lib')
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/api/project_export.rb b/lib/api/project_export.rb index 9163887ac61..8562ae6d737 100644 --- a/lib/api/project_export.rb +++ b/lib/api/project_export.rb @@ -21,8 +21,8 @@ module API detail 'This feature was introduced in GitLab 10.6.' end get ':id/export/download' do - if user_project.export_project_exists? - present_carrierwave_file!(user_ project.export_file) + if user_project.export_file_exists? + present_carrierwave_file!(user_project.export_file) else render_api_error!('404 Not found or has expired', 404) end diff --git a/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb b/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb index 21624cad43a..7cbf653dd97 100644 --- a/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb +++ b/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb @@ -53,7 +53,7 @@ module Gitlab end def self.lock_file_path(project) - return unless project.export_path || object_storage? + return unless project.export_path || export_file_exists? lock_path = project.import_export_shared.archive_path @@ -83,8 +83,8 @@ module Gitlab errors.full_messages.each { |msg| project.import_export_shared.add_error_message(msg) } end - def object_storage? - project.export_project_exists? + def export_file_exists? + project.export_file_exists? end end end diff --git a/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb b/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb index 01c1bca7ec9..4f29bdcea2c 100644 --- a/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb +++ b/lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb @@ -44,7 +44,7 @@ module Gitlab end def export_file - project.export_file.open + project.export_file.open end def send_file_options @@ -59,7 +59,7 @@ module Gitlab end def export_size - project.export_file.file.size + project.export_file.file.size end end end diff --git a/lib/tasks/gitlab/update_templates.rake b/lib/tasks/gitlab/update_templates.rake index be22032287c..ef6a32d6730 100644 --- a/lib/tasks/gitlab/update_templates.rake +++ b/lib/tasks/gitlab/update_templates.rake @@ -54,7 +54,7 @@ namespace :gitlab do end Projects::ImportExport::ExportService.new(project, admin).execute - download_or_copy_upload( project.export_file, template.archive_path) + download_or_copy_upload(project.export_file, template.archive_path) Projects::DestroyService.new(admin, project).execute puts "Exported #{template.name}".green end |