diff options
author | James Lopez <james@jameslopez.es> | 2018-06-25 15:10:26 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-07-06 15:46:18 +0200 |
commit | a2bf1641546a1d3eeb3e9f44734854f655c0adef (patch) | |
tree | 0652c20a92513330aa09c4a2ec9adbfaeb3a6494 /app/controllers/projects_controller.rb | |
parent | b0fa01fce3822da94aee6264829841996beb6df3 (diff) | |
download | gitlab-ce-a2bf1641546a1d3eeb3e9f44734854f655c0adef.tar.gz |
Update Import/Export to use object storage (based on aa feature flag)
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ec3a5788ba1..f2abe27f60e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -2,6 +2,7 @@ class ProjectsController < Projects::ApplicationController include IssuableCollections include ExtractsPath include PreviewMarkdown + include SendFileUpload before_action :whitelist_query_limiting, only: [:create] before_action :authenticate_user!, except: [:index, :show, :activity, :refs] @@ -188,9 +189,9 @@ class ProjectsController < Projects::ApplicationController end def download_export - export_project_path = @project.export_project_path - - if export_project_path + if export_project_object_storage? + send_upload(@project.import_export_upload.export_file) + elsif export_project_path send_file export_project_path, disposition: 'attachment' else redirect_to( @@ -265,8 +266,6 @@ class ProjectsController < Projects::ApplicationController render json: options.to_json end - private - # Render project landing depending of which features are available # So if page is not availble in the list it renders the next page # @@ -424,4 +423,12 @@ class ProjectsController < Projects::ApplicationController def whitelist_query_limiting Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42440') end + + def export_project_path + @export_project_path ||= @project.export_project_path + end + + def export_project_object_storage? + @project.export_project_object_exists? + end end |