From a85bc31c0438eb915b71d986d132d09d5cc247d3 Mon Sep 17 00:00:00 2001 From: Saurabh Choraria Date: Tue, 2 May 2023 09:55:22 +0000 Subject: [PATCH] [FIX] website_slides: prevent traceback while accessing archived embedded slide When user archive a slide from a course and try to access route '/slides/embed/' of that particular slide, user get the error. steps to reproduce: 1. Go to Website and click on courses menu. 2. Open a course and archive a slide in it. 3. Then go to '/slides/embed/' route. 4. Access that particular slide that you have archived in route. 5. The error will occur. Applying this commit will fix this issue. sentry-4025579653 closes odoo/odoo#128797 X-original-commit: c097112109fb2de003242bda89e10e656236b774 Signed-off-by: Thibault Delavallee (tde) --- addons/website_slides/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py index ddbb0c9f841..92e32744e2f 100644 --- a/addons/website_slides/controllers/main.py +++ b/addons/website_slides/controllers/main.py @@ -1511,7 +1511,7 @@ class WebsiteSlides(WebsiteProfile): try: slide = request.env['slide.slide'].browse(slide_id) - if not slide.exists(): + if not slide.exists() or not slide.sudo().active: raise werkzeug.exceptions.NotFound() referer_url = request.httprequest.headers.get('Referer', '')