Skip to content
Snippets Groups Projects
Commit cfe7a8db authored by Julien (jula)'s avatar Julien (jula)
Browse files

[FIX] web: werkzeug.utils.redirect expects string

__Current behavior before PR:__
The `abort_and_redirect` method uses `werkzeug.utils.redirect` which converts the input URL to a string in werkzeug 0.16.1.
However when running odoo with python 3.10, [werkzeug version 2.0.2 is used](https://github.com/odoo/odoo/blob/8985426bf38affedb82990bd2158049b4d6b0bce/requirements.txt#L58).
In this version if the input is not a string `TypeError: replace() takes 1 positional argument but 3 were given - - -` is raised.

__Description of the fix:__
Calls `to_url` method on `url_redirect` to convert it into a string before passing it to `abort_and_redirect`.

__Steps to reproduce the issue:__
1. Run odoo-bin with python 3.10 **or** directly use `werkzeug` version 2.0.2 (`pip install werkzeug==2.0.2`).
2. Go to http://localhost:8069/web/database/selector (in private window)
3. Open a database in Odoo 14
↳ Internal Server Error

Closes: https://github.com/odoo/odoo/issues/111490



opw-3222058

closes odoo/odoo#117959

Signed-off-by: default avatarJulien Castiaux (juc) <juc@odoo.com>
parent b67a8929
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment