]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3480 Editing a default filter shouldn't change its owner.
authorDavid Gageot <david@gageot.net>
Fri, 18 May 2012 10:15:02 +0000 (12:15 +0200)
committerDavid Gageot <david@gageot.net>
Fri, 18 May 2012 10:28:00 +0000 (12:28 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb

index a60379f999821e9b05e0d9f56e8261f392e35825..9e7e6e2afec779da230eab63d4b5bd1cceee3162 100644 (file)
@@ -43,6 +43,7 @@ class FiltersController < ApplicationController
 
   def create
     @filter=::Filter.new()
+    @filter.user_id=current_user.id
     load_filter_from_params(@filter, params)
 
     @filter.columns.build(:family => 'name', :order_index => 1, :sort_direction => 'ASC')
@@ -318,7 +319,6 @@ class FiltersController < ApplicationController
     filter.shared=(params[:shared].present? && is_admin?)
     filter.favourites=params[:favourites].present?
     filter.resource_id=(params[:path_id].present? ? Project.by_key(params[:path_id]).id : nil)
-    filter.user_id=current_user.id
     filter.period_index=params[:period_index].to_i
     filter.criteria=[]
     filter.criteria<<Criterion.new_for_qualifiers(params['qualifiers'])