From 01028b1cf3ae8f48db9c553f5cfe9be4751d7e1b Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 14 Feb 2020 17:25:43 +0000 Subject: [PATCH] [FIX] website_blog: avoid traceback if tag has been deleted Before this commit, if you have a link with a tag that doesn't exists anymore, you will have a traceback because you try to access to a unexisting record. odoo.exceptions.MissingError: ('Record does not exist or has been deleted.\n\n(Records: [3], User: 2)', None) Now, we filter on existing tag before to access a field. X-original-commit: 54b45e5c287138a87a0b04ce4f301ea6893b9223 --- addons/website_blog/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 619938ce118..737731b88a4 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -69,7 +69,7 @@ class WebsiteBlog(http.Controller): active_tag_ids = tags and [unslug(tag)[1] for tag in tags.split(',')] or [] if active_tag_ids: - fixed_tag_slug = ",".join(slug(t) for t in request.env['blog.tag'].browse(active_tag_ids)) + fixed_tag_slug = ",".join(slug(t) for t in request.env['blog.tag'].browse(active_tag_ids).exists()) if fixed_tag_slug != tags: return request.redirect(request.httprequest.full_path.replace("/tag/%s/" % tags, "/tag/%s/" % fixed_tag_slug, 1), 301)