Skip to content

Commit

Permalink
fix: [AXM-24] Fix student's latest enrollment filter
Browse files Browse the repository at this point in the history
  • Loading branch information
KyryloKireiev committed Mar 19, 2024
1 parent a0f720f commit 9a00e92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lms/djangoapps/mobile_api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ def get_primary_enrollment_by_latest_enrollment_or_progress(self) -> Optional[Co
if not latest_progress:
return latest_enrollment

enrollment_with_latest_progress = self.queryset.filter(course_id=latest_progress.course_id).first()
enrollment_with_latest_progress = self.queryset.filter(
course_id=latest_progress.course_id,
user__username=self.kwargs['username'],
).first()

if latest_enrollment.created > latest_progress.modified:
return latest_enrollment
Expand Down

0 comments on commit 9a00e92

Please sign in to comment.