[FIX] website_slides: latest courses should display all my courses

Correctly fetch courses the current user is a member of, not those he already
finished at least a lesson.

Commit linked to task ID 1941250 and PR #31512.
This commit is contained in:
Thibault Delavallée
2019-03-06 14:03:17 +00:00
parent 711a48aaa8
commit 3bdccc0867
+1 -1
View File
@@ -192,7 +192,7 @@ class WebsiteSlides(WebsiteProfile):
domain = request.website.website_domain()
channels_all = request.env['slide.channel'].search(domain)
if not request.env.user._is_public():
channels_my = channels_all.filtered(lambda channel: channel.completion > 0).sorted('completion', reverse=True)[:3]
channels_my = channels_all.filtered(lambda channel: channel.is_member).sorted('completion', reverse=True)[:3]
else:
channels_my = request.env['slide.channel']
channels_popular = channels_all.sorted('total_votes', reverse=True)[:3]