From a3d52557a54a738ef8ba02c44394c261b9992265 Mon Sep 17 00:00:00 2001 From: marcore Date: Mon, 30 Jun 2014 19:16:31 +0200 Subject: [PATCH] Fix filter with new opaque key, allowing user to set COURSE_LISTING as old way path --- lms/djangoapps/branding/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/branding/__init__.py b/lms/djangoapps/branding/__init__.py index b6a0f3c11e..a5fe4d5e2c 100644 --- a/lms/djangoapps/branding/__init__.py +++ b/lms/djangoapps/branding/__init__.py @@ -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')