Merge pull request #4254 from marcore/fix-branding-course-listing-opaque
Fix filter with new opaque key, allowing user to set COURSE_LISTING as o...
This commit is contained in:
@@ -2,9 +2,9 @@ from xmodule.modulestore.django import modulestore
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
from django.conf import settings
|
||||
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from microsite_configuration import microsite
|
||||
|
||||
|
||||
def get_visible_courses():
|
||||
"""
|
||||
Return the set of CourseDescriptors that should be visible in this branded instance
|
||||
@@ -22,7 +22,7 @@ def get_visible_courses():
|
||||
|
||||
# this is legacy format which is outside of the microsite feature -- also handle dev case, which should not filter
|
||||
if hasattr(settings, 'COURSE_LISTINGS') and subdomain in settings.COURSE_LISTINGS and not settings.DEBUG:
|
||||
filtered_visible_ids = frozenset(settings.COURSE_LISTINGS[subdomain])
|
||||
filtered_visible_ids = frozenset([SlashSeparatedCourseKey.from_deprecated_string(c) for c in settings.COURSE_LISTINGS[subdomain]])
|
||||
|
||||
filtered_by_org = microsite.get_value('course_org_filter')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user