summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-25 13:04:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-25 13:04:34 +0000
commitb6742bda3d9179bbfcc4b41398ffa41f7c45ab50 (patch)
tree7004b0f809737b99c244e10be956bf7b1455fa2c /app
parentcf9154f924ff73f4220b9958b245eb59161af17d (diff)
downloadredmine-b6742bda3d9179bbfcc4b41398ffa41f7c45ab50.tar.gz
redmine-b6742bda3d9179bbfcc4b41398ffa41f7c45ab50.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9002 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/sys_controller.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/sys_controller.rb b/app/controllers/sys_controller.rb
index cad3e4ab3..7d58cafb1 100644
--- a/app/controllers/sys_controller.rb
+++ b/app/controllers/sys_controller.rb
@@ -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