mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[fix] runbot: make fast_launch find the last build
This commit is contained in:
parent
4b0eac3b21
commit
08beb51f2e
@ -201,14 +201,14 @@ class Runbot(http.Controller):
|
|||||||
|
|
||||||
if builds:
|
if builds:
|
||||||
last_build = False
|
last_build = False
|
||||||
for build in Build.browse(builds):
|
for build in builds:
|
||||||
if build.state == 'running' or (build.state == 'duplicate' and build.duplicate_id.state == 'running'):
|
if build.state == 'running' or (build.state == 'duplicate' and build.duplicate_id.state == 'running'):
|
||||||
last_build = build if build.state == 'running' else build.duplicate_id
|
last_build = build if build.state == 'running' else build.duplicate_id
|
||||||
break
|
break
|
||||||
|
|
||||||
if not last_build:
|
if not last_build:
|
||||||
# Find the last build regardless the state to propose a rebuild
|
# Find the last build regardless the state to propose a rebuild
|
||||||
last_build = Build.browse(builds[0])
|
last_build = builds[0]
|
||||||
|
|
||||||
if last_build.state != 'running':
|
if last_build.state != 'running':
|
||||||
url = "/runbot/build/%s?ask_rebuild=1" % last_build.id
|
url = "/runbot/build/%s?ask_rebuild=1" % last_build.id
|
||||||
|
Loading…
Reference in New Issue
Block a user