few fixes after refactoring the whole UI stuff

This commit is contained in:
James Lopez 2016-06-14 21:03:14 +02:00
parent b53ed84843
commit ff44198e17
5 changed files with 8 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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