[FIX] website_blog: avoid crash when redirected on /blog
- When browsing the blogs, in some cases the code need
to fix the URL to properly slugify the tags.
When so, the code crashes since it is trying to maniapulate
a `werkzeug.wrappers.Response` as if it was a `dict`.
To avoid this, we directly return the `werkzeug.wrappers.Response`
instead of trying to modify it.
closes odoo/odoo#45658
X-original-commit: d26ba7e4b71138a324bbb729f406cbad562881e7
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -157,6 +157,10 @@ class WebsiteBlog(http.Controller):
|
||||
|
||||
values = self._prepare_blog_values(blogs=blogs, blog=blog, date_begin=date_begin, date_end=date_end, tags=tag, state=state, page=page)
|
||||
|
||||
# in case of a redirection need by `_prepare_blog_values` we follow it
|
||||
if isinstance(values, werkzeug.wrappers.Response):
|
||||
return values
|
||||
|
||||
if blog:
|
||||
values['main_object'] = blog
|
||||
values['edit_in_backend'] = True
|
||||
|
||||
Reference in New Issue
Block a user