Skip to content

Commit

Permalink
Fix issue with duplicate lesson from join.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Apr 9, 2024
1 parent 421626f commit 103a27a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kolibri/core/content/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,8 @@ def filter_by_lesson(self, queryset, name, value):
lesson = Lesson.objects.filter(
lesson_assignments__collection__membership__user=self.request.user,
is_active=True,
).get(pk=value)
pk=value,
).first()
node_ids = list(map(lambda x: x["contentnode_id"], lesson.resources))
return queryset.filter(pk__in=node_ids)
except Lesson.DoesNotExist:
Expand Down

0 comments on commit 103a27a

Please sign in to comment.