From 98241b20e64ac8d5e0afc11e3a8e33f71989c07b Mon Sep 17 00:00:00 2001 From: Pavel Chipiga Date: Fri, 28 Oct 2011 03:04:10 +0300 Subject: [PATCH] Fix XML RPC. Refs #2136 --- app/models/project.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index 7afb443c2..0f764721c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -132,12 +132,21 @@ class Project < ActiveRecord::Base end end - def xml_rpc_destroy - result = BuildServer.delete_project unixname, repository.platform.unixname + def xml_rpc_create + result = BuildServer.create_project unixname, "#{owner.uname}_personal", 'main' if result == BuildServer::SUCCESS return true else - raise "Failed to delete repository #{name} (repo #{repository.name}) inside platform #{repository.platform.name}." + raise "Failed to create project #{name} (repo main) inside platform #{owner.uname}_personal." + end + end + + def xml_rpc_destroy + result = BuildServer.delete_project unixname, "#{owner.uname}_personal" + if result == BuildServer::SUCCESS + return true + else + raise "Failed to delete repository #{name} (repo main) inside platform #{owner.uname}_personal." end end end