Skip to content
Snippets Groups Projects
Commit 6d4b02ac authored by Saurabh Choraria's avatar Saurabh Choraria
Browse files

[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#120280

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent aaf36439
No related branches found
No related tags found
No related merge requests found
......@@ -1125,6 +1125,8 @@ class WebsiteSlides(WebsiteProfile):
# try accessing slide, and display to corresponding template
try:
slide = request.env['slide.slide'].browse(slide_id)
if not slide.active:
raise werkzeug.exceptions.NotFound()
if is_embedded:
request.env['slide.embed'].sudo()._add_embed_url(slide.id, referrer_url)
values = self._get_slide_detail(slide)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment