Skip to content
Snippets Groups Projects
Commit 9e7c5537 authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[FIX] website_slides: fix set viewed slide

Currently a slide that can be previewed is never set as completed. Correct
condition to not update the hard slide-partner relationship is:

 * either current user is public;
 * either current slide is not published (happens when a publisher sees still
   unpublished lessons);
 * either current user is not member of slide channel (happens when seeing a
  free preview slide without being channel member);

Commit linked to task ID 1941250 and PR #31512.
parent 3bdccc08
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ class WebsiteSlides(WebsiteProfile):
return {'slide': slide}
def _set_viewed_slide(self, slide):
if request.env.user._is_public() or slide.is_preview or not slide.channel_id.is_member:
if request.env.user._is_public() or not slide.website_published or not slide.channel_id.is_member:
viewed_slides = request.session.setdefault('viewed_slides', list())
if slide.id not in viewed_slides:
slide.sudo().public_views += 1
......
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