From 292102bac15a08cb2e652f1aebfebafe991c8768 Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Thu, 3 Nov 2022 10:55:16 +0000 Subject: [PATCH] [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) --- addons/website_blog/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 364e261fd57..dfa4e686220 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -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):