Skip to content
Snippets Groups Projects
Commit 5a730aa9 authored by Adeel Khan's avatar Adeel Khan
Browse files

Improve CourseListView end point latency by removing CourseWaffleFlag.

This patch would remove CourseListView slow transaction by changing
CourseWaffleFlag to WaffleFlag. This removes extra hit on
WaffleUtil's model (WaffleFlagCourseOverrideModel).

LEARNER-5566
parent cf6e2d9f
No related branches found
Tags release-2020-08-27-14.14
No related merge requests found
......@@ -91,6 +91,6 @@ def check_course_open_for_learner(user, course):
Returns:
AccessResponse: Either ACCESS_GRANTED or StartDateError.
"""
if COURSE_PRE_START_ACCESS_FLAG.is_enabled(course.id):
if COURSE_PRE_START_ACCESS_FLAG.is_enabled():
return ACCESS_GRANTED
return check_start_date(user, course.days_early_for_beta, course.start, course.id)
......@@ -4,7 +4,7 @@ Unified course experience settings and helper methods.
from django.utils.translation import ugettext as _
from openedx.core.djangoapps.util.user_messages import UserMessageCollection
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlagNamespace
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlagNamespace, WaffleFlag
# Namespace for course experience waffle flags.
......@@ -20,7 +20,7 @@ UNIFIED_COURSE_TAB_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'unified_cours
DISPLAY_COURSE_SOCK_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'display_course_sock')
# Waffle flag to let learners access a course before its start date.
COURSE_PRE_START_ACCESS_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'pre_start_access')
COURSE_PRE_START_ACCESS_FLAG = WaffleFlag(WAFFLE_FLAG_NAMESPACE, 'pre_start_access')
# Waffle flag to enable a review page link from the unified home page.
SHOW_REVIEWS_TOOL_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'show_reviews_tool')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment