Skip to content

Commit

Permalink
[webui] Make before_action private
Browse files Browse the repository at this point in the history
  • Loading branch information
bgeuken committed Oct 9, 2017
1 parent cac9d20 commit 1861973
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/api/app/controllers/webui/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,6 @@ def sourcediff
no_border: true, uid: params[:uid]}
end

def require_request
required_parameters :number
@bs_request = BsRequest.find_by_number params[:number]
return if @bs_request
flash[:error] = "Can't find request #{params[:number]}"
redirect_back(fallback_location: user_show_path(User.current)) && return
end

def changerequest
changestate = nil
%w(accepted declined revoked new).each do |s|
Expand Down Expand Up @@ -365,6 +357,14 @@ def main_object

private

def require_request
required_parameters :number
@bs_request = BsRequest.find_by_number params[:number]
return if @bs_request
flash[:error] = "Can't find request #{params[:number]}"
redirect_back(fallback_location: user_show_path(User.current)) && return
end

def get_target_package_maintainers(actions)
actions = actions.uniq{ |action| action[:tpkg] }
actions.flat_map { |action| Package.find_by_project_and_name(action[:tprj], action[:tpkg]).try(:maintainers) }.compact.uniq
Expand Down

0 comments on commit 1861973

Please sign in to comment.