diff options
author | David Gageot <david@gageot.net> | 2012-10-29 10:44:42 +0100 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-29 10:45:10 +0100 |
commit | e0603258d5ec0702a0a0610aa3b680c8c9a44b09 (patch) | |
tree | 3b5113e32b63e0d1e419192464d05d67ec20c4d7 /sonar-server/src | |
parent | fe0bd12eec0ef48e11f79aacb0de3439663f16a6 (diff) | |
download | sonarqube-e0603258d5ec0702a0a0610aa3b680c8c9a44b09.tar.gz sonarqube-e0603258d5ec0702a0a0610aa3b680c8c9a44b09.zip |
SONAR-3895 Draft of export and can work when project doesn't exist
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/api/synchro_controller.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/synchro_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/synchro_controller.rb index 0dc1be27f8b..e85190acfbd 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/synchro_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/synchro_controller.rb @@ -27,7 +27,8 @@ class Api::SynchroController < Api::ApiController require_parameters :resource load_resource() - dbFileContent = java_facade.createDatabaseForDryRun(@resource.id) + resource_id = @resource.id if @resource + dbFileContent = java_facade.createDatabaseForDryRun(resource_id) send_data String.from_java_bytes(dbFileContent) end @@ -35,10 +36,13 @@ class Api::SynchroController < Api::ApiController private def load_resource - resource_id = params[:resource] - @resource = Project.by_key(resource_id) - return not_found("Resource [#{resource_id}] not found") if @resource.nil? - return access_denied unless is_user?(@resource) + resource_key = params[:resource] + @resource = Project.by_key(resource_key) + if @resource + access_denied unless is_user?(@resource) + else + #access_denied unless is_user?(nil) + end end end |