Skip to content

Commit 50c7a67

Browse files
authored
[FIX] runbot: avoid 404 errors in fast_launch url for odoo >= 9 (odoo#92)
Fix Vauxoo/runbot-addons#88 Cherry-pick from odoo@c1ac96e
1 parent 2e048e2 commit 50c7a67

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

runbot/runbot.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1547,8 +1547,14 @@ def fast_launch(self, branch_name=False, repo=False, **post):
15471547
if last_build.state != 'running':
15481548
url = "/runbot/build/%s?ask_rebuild=1" % last_build.id
15491549
else:
1550-
url = ("http://%s/login?db=%s-all&login=admin&key=admin%s" %
1551-
(last_build.domain, last_build.dest, "&redirect=/web?debug=1" if not build.branch_id.branch_name.startswith('7.0') else ''))
1550+
branch = build.branch_id.branch_name
1551+
if branch.startswith('7'):
1552+
base_url = "http://%s/login?db=%s-all&login=admin&key=admin"
1553+
elif branch.startswith('8'):
1554+
base_url = "http://%s/login?db=%s-all&login=admin&key=admin&redirect=/web?debug=1"
1555+
else:
1556+
base_url = "http://%s/web/login?db=%s-all&login=admin&redirect=/web?debug=1"
1557+
url = base_url % (last_build.domain, last_build.dest)
15521558
else:
15531559
return request.not_found()
15541560
return werkzeug.utils.redirect(url)

0 commit comments

Comments
 (0)