Skip to content

Commit

Permalink
fix: [AXIMST-806] change course version to edited timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Apr 16, 2024
1 parent 383af66 commit 4b1ad45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lms/djangoapps/course_home_api/outline/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,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}'
'course_sidebar_blocks_{course_key_string}_{course_edited_timestamp}_{user_id}_{user_cohort_id}'
'_{enrollment_mode}_{allow_public}_{allow_public_outline}_{is_masquerading}'
)
COURSE_BLOCKS_CACHE_TIMEOUT = 60 * 60 # 1 hour
Expand Down Expand Up @@ -451,7 +451,7 @@ def get(self, request, *args, **kwargs):

cache_key = self.COURSE_BLOCKS_CACHE_KEY_TEMPLATE.format(
course_key_string=course_key_string,
course_version=str(course.course_version),
course_edited_timestamp=str(course.subtree_edited_on.timestamp()),
user_id=request.user.id,
enrollment_mode=getattr(enrollment, 'mode', ''),
user_cohort_id=getattr(user_cohort, 'id', ''),
Expand Down

0 comments on commit 4b1ad45

Please sign in to comment.