Skip to content

Commit

Permalink
fix: course outline now working for MFE
Browse files Browse the repository at this point in the history
 This changes fixes the case when:

 1. The course visbility in studio advance settings is set to 'none'.
 2. The `COURSE_ABOUT_VISIBILITY_PERMISSION` is set `see_about_page`.

 The fix is done by assuming that whenever a learner is accsing
 course content and they are **enrolled**, then we use 'load'
 action for them see (course detail/course outline), as oppiste
 to the default which would use `COURSE_ABOUT_VISIBILITY_PERMISSION`
 no matter if learner enrolled or not enrolled.

 Note this change dosn't affect the log `course-id/about` page
 at all, since that view doesn't use this view.
  • Loading branch information
ghassanmas committed Aug 26, 2024
1 parent 66f3a08 commit aa8b315
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lms/djangoapps/course_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ def course_detail(request, username, course_key):
user = get_effective_user(request.user, username)
overview = get_course_overview_with_access(
user,
get_permission_for_course_about(),
course_key,
action=(
"load"
if CourseEnrollment.is_enrolled(request.user, course_key)
else get_permission_for_course_about()
),
course_key=course_key,
)
overview.effective_user = user
return overview
Expand Down

0 comments on commit aa8b315

Please sign in to comment.