diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-07-07 16:52:29 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-07-08 12:44:29 +0200 |
commit | ab609ec8c8b73b833835550d97fe5fe283c6bf44 (patch) | |
tree | 589a944f861835fab48bdeb2f589affced385c47 /server/sonar-web | |
parent | d3b7c326fca7e01901f29fa75d953f43d478f3bb (diff) | |
download | sonarqube-ab609ec8c8b73b833835550d97fe5fe283c6bf44.tar.gz sonarqube-ab609ec8c8b73b833835550d97fe5fe283c6bf44.zip |
SONAR-7690 fix /api/events use of Event.already_exists
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/events_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/events_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/events_controller.rb index 1f3a7f78502..2f01c8e0ab6 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/events_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/events_controller.rb @@ -125,7 +125,7 @@ class Api::EventsController < Api::ApiController begin load_resource(:admin, params[:resource]) raise "Resource must be a root project" unless @resource.scope=='PRJ' - + analysis=nil if (params[:dateTime]) # try to find a snapshot on that day @@ -135,9 +135,9 @@ class Api::EventsController < Api::ApiController else analysis = Snapshot.find(:last, :conditions => ["component_uuid = ?", @resource.uuid], :order => :created_at) end - + raise "A version already exists on this resource." if params[:category]==EventCategory::KEY_VERSION && analysis.event(EventCategory::KEY_VERSION) - raise "An event '#{params[:name]}' (category '#{params[:category]}') already exists on this resource." if Event.already_exists(@resource.last_analysis.id, params[:name], params[:category]) + raise "An event '#{params[:name]}' (category '#{params[:category]}') already exists on this resource." if Event.already_exists(@resource.last_analysis.uuid, params[:name], params[:category]) event_to_return = nil name = params[:name] |