mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: Fix KeyError if there are sticky branches without builds
Before this commit, when a clean instance of the runbot is installed, there was a KeyError on the frontend because there was not builds for the sticky branches.
This commit is contained in:
parent
c9de61a320
commit
1e7edad85a
@ -113,7 +113,7 @@ class Runbot(http.Controller):
|
|||||||
def branch_info(branch):
|
def branch_info(branch):
|
||||||
return {
|
return {
|
||||||
'branch': branch,
|
'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({
|
context.update({
|
||||||
|
@ -120,7 +120,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<i t-if="br['branch'].sticky" class="fa fa-star" style="color: #f0ad4e" />
|
<i t-if="br['branch'].sticky" class="fa fa-star" style="color: #f0ad4e" />
|
||||||
<b t-esc="br['branch'].branch_name"/>
|
<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">
|
<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="{{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>
|
<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