mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: Fix KeyError if there are sticky branches without builds
This commit is contained in:
parent
d86f117fcd
commit
5ccf67513d
@ -113,7 +113,7 @@ class Runbot(http.Controller):
|
||||
def branch_info(branch):
|
||||
return {
|
||||
'branch': branch,
|
||||
'builds': [self.build_info(build_dict[build_id]) for build_id in build_by_branch_ids[branch.id]]
|
||||
'builds': [self.build_info(build_dict[build_id]) for build_id in build_by_branch_ids.get(branch.id) or []]
|
||||
}
|
||||
|
||||
context.update({
|
||||
|
@ -120,7 +120,7 @@
|
||||
<td>
|
||||
<i t-if="br['branch'].sticky" class="fa fa-star" style="color: #f0ad4e" />
|
||||
<b t-esc="br['branch'].branch_name"/>
|
||||
<small><t t-esc="br['builds'][0]['job_age']"/></small><br/>
|
||||
<small><t t-esc="br['builds'] and br['builds'][0]['job_age']"/></small><br/>
|
||||
<div class="btn-group btn-group-xs">
|
||||
<a t-attf-href="{{br['branch'].branch_url}}" class="btn btn-default btn-xs">Branch or pull <i class="fa fa-github"/></a>
|
||||
<a t-attf-href="/runbot/#{repo.id}/#{br['branch'].branch_name}" class="btn btn-default btn-xs" aria-label="Quick Connect"><i class="fa fa-fast-forward" title="Quick Connect"/></a>
|
||||
|
Loading…
Reference in New Issue
Block a user