Skip to content
Snippets Groups Projects
Commit 885d8a18 authored by Abdelouahab (abla)'s avatar Abdelouahab (abla)
Browse files

[FIX] website_slides: avoid completing slide when not being a member


To reproduce
============
- add video to a course
- remove user from course if user is enrolled
- open video in full screen mode and play it
- move nearly to the last part of the video so that is detected as completed
- an error will occure

Problem
=======
- when the video is detected to be completed we want to mark the slide as completed
- as the user is not a member, we can't retreive the current slide which is the source
of this issue

Solution
========
as the use is not a member, marking the slide as **Completed** dosen't make any sense,
so checking if the user is member, should solve the problem.

opw-3295662

closes odoo/odoo#121062

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 99d0db32
No related branches found
No related tags found
No related merge requests found
......@@ -114,7 +114,7 @@
self.currentVideoTime += 1;
if (self.totalVideoTime && self.currentVideoTime > self.totalVideoTime - 30){
clearInterval(self.tid);
if (!self.slide.hasQuestion && !self.slide.completed){
if (self.slide.isMember && !self.slide.hasQuestion && !self.slide.completed){
self.trigger_up('slide_mark_completed', self.slide);
}
}
......@@ -216,7 +216,7 @@
*/
_onVideoTimeUpdate: async function (eventData) {
if (eventData.seconds > (this.videoDuration - 30)) {
if (!this.slide.hasQuestion && !this.slide.completed){
if (this.slide.isMember && !this.slide.hasQuestion && !this.slide.completed){
this.trigger_up('slide_mark_completed', this.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