Skip to content

Commit

Permalink
fix: [AXIMST-791] Refresh cache when changing Enrollment tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Apr 11, 2024
1 parent bec38d1 commit 779c01f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lms/djangoapps/course_home_api/outline/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ class CourseNavigationBlocksView(RetrieveAPIView):
**Use Cases**
Request details for the sidebar navigation of the course.
**Example Requests**
GET api/course_home/v1/sidebar/{course_key}
GET api/course_home/v1/navigation/{course_key}
**Response Values**
For a good 200 response, the response will include:
blocks: List of serialized Course Block objects. Each serialization has the following fields:
Expand Down Expand Up @@ -417,7 +417,7 @@ class CourseNavigationBlocksView(RetrieveAPIView):
serializer_class = CourseBlockSerializer
COURSE_BLOCKS_CACHE_KEY_TEMPLATE = (
'course_sidebar_blocks_{course_key_string}_{course_version}_{user_id}_{user_cohort_id}'
'_{allow_public}_{allow_public_outline}_{is_masquerading}'
'_{enrollment_mode}_{allow_public}_{allow_public_outline}_{is_masquerading}'
)
COURSE_BLOCKS_CACHE_TIMEOUT = 60 * 60 # 1 hour

Expand Down Expand Up @@ -453,6 +453,7 @@ def get(self, request, *args, **kwargs):
course_key_string=course_key_string,
course_version=str(course.course_version),
user_id=request.user.id,
enrollment_mode=getattr(enrollment, 'mode', ''),
user_cohort_id=getattr(user_cohort, 'id', ''),
allow_public=allow_public,
allow_public_outline=allow_public_outline,
Expand Down

0 comments on commit 779c01f

Please sign in to comment.