Skip to content
Snippets Groups Projects
Commit 4aab04e4 authored by Calen Pennington's avatar Calen Pennington
Browse files

Merge pull request #290 from MITx/feature/cpennington/disable-start-date-flag

Add feature flag for disabling course start dates
parents d8f8d8c6 98910a2d
No related merge requests found
......@@ -36,7 +36,8 @@ def check_course(course_id, course_must_be_open=True, course_required=True):
except (KeyError, ItemNotFoundError):
raise Http404("Course not found.")
if course_must_be_open and not course.has_started():
started = course.has_started() or settings.MITX_FEATURES['DISABLE_START_DATES']
if course_must_be_open and not started:
raise Http404("This course has not yet started.")
return course
......
......@@ -41,6 +41,10 @@ MITX_FEATURES = {
'DISPLAY_HISTOGRAMS_TO_STAFF' : True,
'REROUTE_ACTIVATION_EMAIL' : False, # nonempty string = address for all activation emails
'DEBUG_LEVEL' : 0, # 0 = lowest level, least verbose, 255 = max level, most verbose
## DO NOT SET TO True IN THIS FILE
## 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
}
# Used for A/B testing
......
......@@ -13,6 +13,8 @@ from .logsettings import get_logger_config
DEBUG = True
TEMPLATE_DEBUG = True
MITX_FEATURES['DISABLE_START_DATES'] = True
WIKI_ENABLED = True
LOGGING = get_logger_config(ENV_ROOT / "log",
......
......@@ -65,7 +65,7 @@
<article class="my-course">
<%
if course.has_started():
if course.has_started() or settings.MITX_FEATURES['DISABLE_START_DATES']:
course_target = reverse('info', args=[course.id])
else:
course_target = reverse('about_course', args=[course.id])
......
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