diff --git a/src/api/app/controllers/webui/feeds_controller.rb b/src/api/app/controllers/webui/feeds_controller.rb index 2534f914f8f..c61c5d80a24 100644 --- a/src/api/app/controllers/webui/feeds_controller.rb +++ b/src/api/app/controllers/webui/feeds_controller.rb @@ -21,12 +21,20 @@ def commits return end unless params[:starting_at].blank? - @start = (Time.zone.parse(params[:starting_at]) rescue nil) + @start = (begin + Time.zone.parse(params[:starting_at]) + rescue + nil + end) end @start ||= 7.days.ago @finish = nil unless params[:ending_at].blank? - @finish = (Time.zone.parse(params[:ending_at]) rescue nil) + @finish = (begin + Time.zone.parse(params[:ending_at]) + rescue + nil + end) end @commits = @project.project_log_entries.where(event_type: 'commit').where(["datetime >= ?", @start]) @commits = @commits.where(["datetime <= ?", @finish]) unless @finish.nil? diff --git a/src/api/app/controllers/webui/project_controller.rb b/src/api/app/controllers/webui/project_controller.rb index 90ca8177eaa..45cc306e9f5 100644 --- a/src/api/app/controllers/webui/project_controller.rb +++ b/src/api/app/controllers/webui/project_controller.rb @@ -435,7 +435,11 @@ def monitor @name_filter = params[:pkgname] @lastbuild_switch = params[:lastbuild] if params[:defaults] - defaults = (Integer(params[:defaults]) rescue 1) > 0 + defaults = (begin + Integer(params[:defaults]) + rescue + 1 + end) > 0 else defaults = true end @@ -874,7 +878,11 @@ def monitor_set_filter(defaults) @avail_status_values.each { |s| id = s.delete(' ') if params.has_key?(id) - next unless (Integer(params[id]) rescue 1) > 0 + next unless (begin + Integer(params[id]) + rescue + 1 + end) > 0 else next unless defaults end diff --git a/src/api/test/functional/webui/owner_search_test.rb b/src/api/test/functional/webui/owner_search_test.rb index d4abf52bc7c..894f92d0b93 100644 --- a/src/api/test/functional/webui/owner_search_test.rb +++ b/src/api/test/functional/webui/owner_search_test.rb @@ -46,9 +46,21 @@ def search_results raw_results = page.all("div.search_result") raw_results.collect do |row| { - project: (row.find("a.project").text rescue nil), - package: (row.find("a.package").text rescue nil), - owners: (row.find("p").text rescue nil) + project: (begin + row.find("a.project").text + rescue + nil + end), + package: (begin + row.find("a.package").text + rescue + nil + end), + owners: (begin + row.find("p").text + rescue + nil + end) } end end