[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/<int:slide_id>' 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/<int:slide_id>' 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) <tde@openerp.com>
This commit is contained in:
Saurabh Choraria
2023-07-18 11:42:39 +02:00
parent 72edf3c885
commit a85bc31c04
+1 -1
View File
@@ -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', '')