Skip to content

Commit

Permalink
[FIX] runbot: avoid 404 errors in fast_launch url for odoo >= 9 (odoo#92
Browse files Browse the repository at this point in the history
)

Fix Vauxoo/runbot-addons#88

Cherry-pick from odoo@c1ac96e
  • Loading branch information
moylop260 authored Feb 13, 2017
1 parent 2e048e2 commit 50c7a67
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions runbot/runbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,14 @@ def fast_launch(self, branch_name=False, repo=False, **post):
if last_build.state != 'running':
url = "/runbot/build/%s?ask_rebuild=1" % last_build.id
else:
url = ("http://%s/login?db=%s-all&login=admin&key=admin%s" %
(last_build.domain, last_build.dest, "&redirect=/web?debug=1" if not build.branch_id.branch_name.startswith('7.0') else ''))
branch = build.branch_id.branch_name
if branch.startswith('7'):
base_url = "http://%s/login?db=%s-all&login=admin&key=admin"
elif branch.startswith('8'):
base_url = "http://%s/login?db=%s-all&login=admin&key=admin&redirect=/web?debug=1"
else:
base_url = "http://%s/web/login?db=%s-all&login=admin&redirect=/web?debug=1"
url = base_url % (last_build.domain, last_build.dest)
else:
return request.not_found()
return werkzeug.utils.redirect(url)
Expand Down

0 comments on commit 50c7a67

Please sign in to comment.