From f20f6667fabda167757f2f20021e628d010dd906 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 27 Jan 2023 15:53:47 +0000 Subject: [PATCH] [FIX] website_forum: add default value for forum_origin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a lot of hits without any forum_origin which will raise an error 500 because this parameter is required. But because this params is not into the controller but received as a get parameter, it will match the controller and return an error 500 instead of a beautiful 404. Some controller like 'open_partner' redirect to this url without the parameter forum_origin too, leading in a 500 in all cases. Better for uX to have this param, but not critical to display the page. The only negative impact will be to have a 'Back' button that return to this new default value '/forum'. closes odoo/odoo#114461 X-original-commit: 991d1c430f2c9bb0d2b2d7ac8f75338eafd2aced Signed-off-by: Jérémy Kersten --- addons/website_forum/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 5496be05148..572851ed15b 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -561,7 +561,7 @@ class WebsiteForum(WebsiteProfile): # ----------------------------------- @http.route(['/forum//user/'], type='http', auth="public", website=True) - def view_user_forum_profile(self, forum, user_id, forum_origin, **post): + def view_user_forum_profile(self, forum, user_id, forum_origin='/forum', **post): return request.redirect('/profile/user/' + str(user_id) + '?forum_id=' + str(forum.id) + '&forum_origin=' + str(forum_origin)) def _prepare_user_profile_values(self, user, **post):