summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-01 20:09:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-01 20:09:08 +0000
commit42d3f7e5040ce10d889e9070103dd46a9e11a2b7 (patch)
treefc155fea121c6e0d7be64a26b070a8cb1c907d47 /app
parentdd92a53b14660bb3db6ca03ffe778cd18b0dbf1e (diff)
downloadredmine-42d3f7e5040ce10d889e9070103dd46a9e11a2b7.tar.gz
redmine-42d3f7e5040ce10d889e9070103dd46a9e11a2b7.zip
Use JSON instead of XML for reposman.rb.
git-svn-id: http://svn.redmine.org/redmine/trunk@16591 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 6ef72a15f..e7f5ebe12 100644
--- a/app/controllers/sys_controller.rb
+++ b/app/controllers/sys_controller.rb
@@ -22,7 +22,7 @@ class SysController < ActionController::Base
p = Project.active.has_module(:repository).
order("#{Project.table_name}.identifier").preload(:repository).to_a
# extra_info attribute from repository breaks activeresource client
- render :xml => p.to_xml(
+ render :json => p.to_json(
:only => [:id, :identifier, :name, :is_public, :status],
:include => {:repository => {:only => [:id, :url]}}
)
@@ -34,10 +34,11 @@ class SysController < ActionController::Base
head 409
else
logger.info "Repository for #{project.name} was reported to be created by #{request.remote_ip}."
- repository = Repository.factory(params[:vendor], params[:repository])
+ repository = Repository.factory(params[:vendor])
+ repository.safe_attributes = params[:repository]
repository.project = project
if repository.save
- render :xml => {repository.class.name.underscore.gsub('/', '-') => {:id => repository.id, :url => repository.url}}, :status => 201
+ render :json => {repository.class.name.underscore.gsub('/', '-') => {:id => repository.id, :url => repository.url}}, :status => 201
else
head 422
end