Browse files

[api] fix syntax error when trigger a rebuild

  • Loading branch information...
1 parent f425c7d commit d67aa3579fab0fc654717e5b5600b407a88f59ea @adrianschroeter adrianschroeter committed Jul 7, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/api/app/controllers/source_controller.rb
View
5 src/api/app/controllers/source_controller.rb
@@ -869,7 +869,8 @@ def index_branch
branch_target_package = pac.name
else
# package exists not yet in update project, but it may have a project link ?
- if find_package( DbProject.find_by_name(a.values[0].value), pac.name )
+ p = DbProject.find_by_name(a.values[0].value)
+ if p and p.find_package( pac.name )
branch_target_project = a.values[0].value
end
end
@@ -1045,7 +1046,7 @@ def index_package_rebuild
end
begin
- pkg = find_package( p, package_name )
+ pkg = p.find_package( package_name )
rescue DbProject::CycleError => e
render_error :status => 400, :errorcode => 'project_cycle', :message => e.message
return

0 comments on commit d67aa35

Please sign in to comment.