From da16b3da22e105112f0502d652d5725ae7a41aee Mon Sep 17 00:00:00 2001 From: Renzo Lucioni Date: Fri, 11 Dec 2015 14:44:40 -0500 Subject: [PATCH] Remove dead code Deletes unused code from an old implementation of microsites. --- common/djangoapps/student/views.py | 8 ++------ lms/djangoapps/courseware/courses.py | 2 +- lms/djangoapps/courseware/views.py | 2 +- lms/envs/common.py | 20 -------------------- lms/envs/dev.py | 2 -- 5 files changed, 4 insertions(+), 30 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 7f15b12f78..30756d8d20 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -156,13 +156,9 @@ def index(request, extra_context=None, user=AnonymousUser()): """ if extra_context is None: extra_context = {} - # The course selection work is done in courseware.courses. - domain = settings.FEATURES.get('FORCE_UNIVERSITY_DOMAIN') # normally False - # do explicit check, because domain=None is valid - if domain is False: - domain = request.META.get('HTTP_HOST') - courses = get_courses(user, domain=domain) + courses = get_courses(user) + if microsite.get_value("ENABLE_COURSE_SORTING_BY_START_DATE", settings.FEATURES["ENABLE_COURSE_SORTING_BY_START_DATE"]): courses = sort_by_start_date(courses) diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index 4227058d9a..ae8852d977 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -373,7 +373,7 @@ def get_course_syllabus_section(course, section_key): raise KeyError("Invalid about key " + str(section_key)) -def get_courses(user, domain=None, org=None): # pylint: disable=unused-argument +def get_courses(user, org=None): """ Returns a list of courses available, sorted by course.number and optionally filtered by org code (case-insensitive). diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index fedb631743..72c47b6592 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -136,7 +136,7 @@ def courses(request): courses_list = [] course_discovery_meanings = getattr(settings, 'COURSE_DISCOVERY_MEANINGS', {}) if not settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'): - courses_list = get_courses(request.user, request.META.get('HTTP_HOST')) + courses_list = get_courses(request.user) if microsite.get_value("ENABLE_COURSE_SORTING_BY_START_DATE", settings.FEATURES["ENABLE_COURSE_SORTING_BY_START_DATE"]): diff --git a/lms/envs/common.py b/lms/envs/common.py index f96841d390..da1c224e66 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -73,31 +73,11 @@ FEATURES = { ## Doing so will cause all courses to be released on production 'DISABLE_START_DATES': False, # When True, all courses will be active, regardless of start date - # When True, will only publicly list courses by the subdomain. - 'SUBDOMAIN_COURSE_LISTINGS': False, - # Expects you to define COURSE_LISTINGS, a dictionary mapping - # subdomains to lists of course_ids - # COURSE_LISTINGS = { - # 'default': [ - # 'BerkeleyX/CS169.1x/2012_Fall', - # 'HarvardX/CS50x/2012', - # 'MITx/3.091x/2012_Fall', - # ], - # 'openedx': [ - # 'BerkeleyX/CS169.1x/2012_Fall', - # ], - # } - # To see it in action, add the following to your /etc/hosts file: - # 127.0.0.1 openedx.dev - # When True, will override certain branding with university specific values # Expects a SUBDOMAIN_BRANDING dictionary that maps the subdomain to the # university to use for branding purposes 'SUBDOMAIN_BRANDING': False, - 'FORCE_UNIVERSITY_DOMAIN': False, # set this to the university domain to use, as an override to HTTP_HOST - # set to None to do no university selection - # for consistency in user-experience, keep the value of the following 3 settings # in sync with the corresponding ones in cms/envs/common.py 'ENABLE_DISCUSSION_SERVICE': True, diff --git a/lms/envs/dev.py b/lms/envs/dev.py index f84fac987d..9ac93a1de0 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -20,9 +20,7 @@ TEMPLATE_DEBUG = True HTTPS = 'off' FEATURES['DISABLE_START_DATES'] = False FEATURES['ENABLE_SQL_TRACKING_LOGS'] = True -FEATURES['SUBDOMAIN_COURSE_LISTINGS'] = False # Enable to test subdomains--otherwise, want all courses to show up FEATURES['SUBDOMAIN_BRANDING'] = True -FEATURES['FORCE_UNIVERSITY_DOMAIN'] = None # show all university courses if in dev (ie don't use HTTP_HOST) FEATURES['ENABLE_MANUAL_GIT_RELOAD'] = True FEATURES['ENABLE_SERVICE_STATUS'] = True FEATURES['ENABLE_INSTRUCTOR_EMAIL'] = True # Enable email for all Studio courses