Skip to content

Commit

Permalink
Merge pull request #6505 from bgeuken/fix_lookup_issue
Browse files Browse the repository at this point in the history
Fix lookup issue due to conflicting namespaces
  • Loading branch information
bgeuken committed Dec 7, 2018
2 parents 5287d4f + 4fb7211 commit d622b0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/api/app/controllers/webui/package_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def submit_request
flash[:error] = "Unable to diff sources: #{e.message}"
rescue BsRequestAction::MissingAction => e
flash[:error] = 'Unable to submit, sources are unchanged'
rescue Project::UnknownObjectError,
rescue ::Project::UnknownObjectError,
BsRequestAction::UnknownProject,
BsRequestAction::UnknownTargetPackage => e
redirect_back(fallback_location: root_path, error: "Unable to submit (missing target): #{e.message}")
Expand Down Expand Up @@ -465,7 +465,7 @@ def rdiff
@last_rev = @package.dir_hash['rev']
@linkinfo = @package.linkinfo
if params[:oproject]
@oproject = Project.find_by_name(params[:oproject])
@oproject = ::Project.find_by_name(params[:oproject])
@opackage = @oproject.find_package(params[:opackage]) if @oproject && params[:opackage]
end

Expand Down Expand Up @@ -1128,8 +1128,8 @@ def add_path(action)
#
# If the check succeeds it sets @project and @package variables.
def check_build_log_access
if Project.exists_by_name(params[:project])
@project = Project.get_by_name(params[:project])
if ::Project.exists_by_name(params[:project])
@project = ::Project.get_by_name(params[:project])
else
redirect_to root_path, error: "Couldn't find project '#{params[:project]}'. Are you sure it still exists?"
return false
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/webui_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def handle_unverified_request

def set_project
# We've started to use project_name for new routes...
@project = Project.find_by(name: params[:project_name] || params[:project])
@project = ::Project.find_by(name: params[:project_name] || params[:project])
raise ActiveRecord::RecordNotFound unless @project
end

Expand Down

0 comments on commit d622b0c

Please sign in to comment.