Commit ff44198e authored by James Lopez's avatar James Lopez

few fixes after refactoring the whole UI stuff

parent b53ed848
......@@ -14,7 +14,7 @@ class Import::GitlabProjectsController < Import::BaseController
@project = Gitlab::ImportExport::ProjectCreator.new(project_params[:namespace_id],
current_user,
File.expand_path(params[:file].path),
File.expand_path(project_params[:file].path),
project_params[:path]).execute
if @project.saved?
......@@ -33,7 +33,7 @@ class Import::GitlabProjectsController < Import::BaseController
private
def file_is_valid?
params[:file].respond_to?(:read) && params[:file].content_type == 'application/x-gzip'
project_params[:file].respond_to?(:read) && project_params[:file].content_type == 'application/x-gzip'
end
def verify_project_and_namespace_access
......@@ -52,7 +52,7 @@ class Import::GitlabProjectsController < Import::BaseController
def project_params
params.permit(
:path, :namespace_id,
:path, :namespace_id, :file
)
end
end
......@@ -7,7 +7,7 @@
Forking in progress.
- else
Import in progress.
- unless @project.forked?
- unless @project.forked? || @project.gitlab_project_import?
%p.monospace git clone --bare #{@project.safe_import_url}
%p Please wait while we import the repository for you. Refresh at will.
:javascript
......
......@@ -15,8 +15,6 @@ module Gitlab
if check_version! && [project_tree, repo_restorer, wiki_restorer, uploads_restorer].all?(&:restore)
project_tree.restored_project
else
project_tree.restored_project.destroy if project_tree.restored_project
raise Projects::ImportService::Error.new, @shared.errors.join(', ')
end
end
......
......@@ -57,10 +57,10 @@ module Gitlab
author = @relation_hash.delete('author')
update_note_for_missing_author(author['name']) if missing_author?
update_note_for_missing_author(author['name']) if missing_author?(old_author_id)
end
def missing_author?
def missing_author?(old_author_id)
!admin_user? || @members_mapper.missing_author_ids.include?(old_author_id)
end
......
......@@ -17,13 +17,13 @@ module Gitlab
error_out(error.message, caller[0].dup)
@errors << error.message
# Debug:
Rails.logger.error(error.backtrace)
logger.error(error.backtrace)
end
private
def error_out(message, caller)
Rails.logger.error("Import/Export error raised on #{caller}: #{message}")
logger.error("Import/Export error raised on #{caller}: #{message}")
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment