diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index 6954afd7..a115e537 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -495,6 +495,8 @@ class Runbot(Controller): limit -= len(builds) builds |= builds.search(builds_domain, order='id desc', limit=limit) + if not builds: + return {} builds = builds.search([('id', 'child_of', builds.ids)]) @@ -502,7 +504,8 @@ class Runbot(Controller): request.env.cr.execute("SELECT build_id, values FROM runbot_build_stat WHERE build_id IN %s AND category = %s", [tuple(builds.ids), key_category]) # read manually is way faster than using orm res = {} for (build_id, values) in request.env.cr.fetchall(): - res.setdefault(parents[build_id], {}).update(values) + if values: + res.setdefault(parents[build_id], {}).update(values) # we need to update here to manage the post install case: we want to combine stats from all post_install childrens. return res