[FIX] website_blog: fix the date filter on the blog posts

Since [this commit], following these steps:
- Go to /blog
- Activate the sidebar option
- Select a date filter on the sidebar

=> An error occurs.
The bug comes from the fact that since [this commit], some arguments
were passed twice to a function which causes a python error. The fix is
just to not pass the same argument several times.

[this commit]: https://github.com/odoo/odoo/commit/f2e20e5377a6604084aaf509f57614d7fbf263e5

Related to opw-2882492

closes odoo/odoo#104639

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Guillaume (gdi)
2022-11-07 13:49:58 +01:00
parent 6782ec3f95
commit 292102bac1
+2 -2
View File
@@ -198,7 +198,7 @@ class WebsiteBlog(http.Controller):
if not blog and len(blogs) == 1:
return request.redirect('/blog/%s' % slug(blogs[0]), code=302)
date_begin, date_end, state = opt.get('date_begin'), opt.get('date_end'), opt.get('state')
date_begin, date_end = opt.get('date_begin'), opt.get('date_end')
if tag and request.httprequest.method == 'GET':
# redirect get tag-1,tag-2 -> get tag-1
@@ -207,7 +207,7 @@ class WebsiteBlog(http.Controller):
url = QueryURL('' if blog else '/blog', ['blog', 'tag'], blog=blog, tag=tags[0], date_begin=date_begin, date_end=date_end, search=search)()
return request.redirect(url, code=302)
values = self._prepare_blog_values(blogs=blogs, blog=blog, date_begin=date_begin, date_end=date_end, tags=tag, state=state, page=page, search=search, **opt)
values = self._prepare_blog_values(blogs=blogs, blog=blog, tags=tag, page=page, search=search, **opt)
# in case of a redirection need by `_prepare_blog_values` we follow it
if isinstance(values, werkzeug.wrappers.Response):