Skip to content

Commit

Permalink
[FIX] only work on branches with builds
Browse files Browse the repository at this point in the history
fixes odoo#83
  • Loading branch information
hbrunn committed Dec 8, 2015
1 parent 1e2d4bf commit 622b5d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runbot/runbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ def repo(self, repo=None, search='', limit='100', refresh='', **post):
domain += ['|', '|', ('dest', 'ilike', search), ('subject', 'ilike', search), ('branch_id.branch_name', 'ilike', search)]

build_ids = build_obj.search(cr, uid, domain, limit=int(limit))
branch_ids, build_by_branch_ids = [], {}
build_by_branch_ids = {}

if build_ids:
branch_query = """
Expand Down Expand Up @@ -1214,7 +1214,7 @@ def repo(self, repo=None, search='', limit='100', refresh='', **post):
rec[0]: [r for r in rec[1:] if r is not None] for rec in cr.fetchall()
}

branches = branch_obj.browse(cr, uid, branch_ids, context=request.context)
branches = branch_obj.browse(cr, uid, build_by_branch_ids.keys(), context=request.context)
build_ids = flatten(build_by_branch_ids.values())
build_dict = {build.id: build for build in build_obj.browse(cr, uid, build_ids, context=request.context) }

Expand Down

0 comments on commit 622b5d9

Please sign in to comment.