Code cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9002 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-02-25 13:04:34 +00:00
parent cf9154f924
commit b6742bda3d
1 changed files with 4 additions and 3 deletions

View File

@ -37,9 +37,10 @@ class SysController < ActionController::Base
render :nothing => true, :status => 409
else
logger.info "Repository for #{project.name} was reported to be created by #{request.remote_ip}."
project.repository = Repository.factory(params[:vendor], params[:repository])
if project.repository && project.repository.save
render :xml => {project.repository.class.name.underscore.gsub('/', '-') => {:id => project.repository.id, :url => project.repository.url}}, :status => 201
repository = Repository.factory(params[:vendor], params[:repository])
repository.project = project
if repository.save
render :xml => {repository.class.name.underscore.gsub('/', '-') => {:id => repository.id, :url => repository.url}}, :status => 201
else
render :nothing => true, :status => 422
end