Skip to content

Commit

Permalink
[webui] use existens check, not emulating it
Browse files Browse the repository at this point in the history
also fixing situation where package does not exist, but remote projects are linked
  • Loading branch information
adrianschroeter committed Oct 21, 2015
1 parent 0e7768d commit 6728926
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/api/app/controllers/webui/package_controller.rb
Expand Up @@ -576,10 +576,7 @@ def save_new_link
return
end

begin
# just as existence check
Package.get_by_project_and_name(@linked_project, @linked_package)
rescue APIException
unless Package.exists_by_project_and_name(@linked_project, @linked_package)
flash[:error] = "Unable to find package '#{@linked_package}' in project '#{@linked_project}'."
redirect_to :controller => :project, :action => 'new_package_branch', :project => @project
return
Expand Down

0 comments on commit 6728926

Please sign in to comment.