diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py
index 137e71b24a..87a2943773 100644
--- a/cms/djangoapps/contentstore/views.py
+++ b/cms/djangoapps/contentstore/views.py
@@ -122,7 +122,8 @@ def index(request):
course.location.course,
course.location.name]))
for course in courses],
- 'user': request.user
+ 'user': request.user,
+ 'disable_course_creation': settings.MITX_FEATURES.get('DISABLE_COURSE_CREATION', False) and not request.user.is_staff
})
@@ -1259,6 +1260,10 @@ def edge(request):
@login_required
@expect_json
def create_new_course(request):
+
+ if settings.MITX_FEATURES.get('DISABLE_COURSE_CREATION', False) and not request.user.is_staff:
+ raise PermissionDenied()
+
# This logic is repeated in xmodule/modulestore/tests/factories.py
# so if you change anything here, you need to also change it there.
# TODO: write a test that creates two courses, one with the factory and
diff --git a/cms/templates/index.html b/cms/templates/index.html
index 92987babda..45c4edc176 100644
--- a/cms/templates/index.html
+++ b/cms/templates/index.html
@@ -37,7 +37,9 @@
My Courses
% if user.is_active:
- New Course
+ % if not disable_course_creation:
+ New Course
+ %endif
%for course, url in courses:
-
diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py
index d6ad9ba4eb..4413ebfc0f 100644
--- a/common/djangoapps/student/views.py
+++ b/common/djangoapps/student/views.py
@@ -1112,9 +1112,11 @@ def test_center_login(request):
# or possibly both. But for now we know what to do with an ExamSeriesCode,
# while we currently have no record of RegistrationID values at all.
if 'vueExamSeriesCode' not in request.POST:
- # TODO: confirm this error code (made up, not in documentation)
+ # we are not allowed to make up a new error code, according to Pearson,
+ # so instead of "missingExamSeriesCode", we use a valid one that is
+ # inaccurate but at least distinct. (Sigh.)
log.error("missing exam series code for cand ID {}".format(client_candidate_id))
- return HttpResponseRedirect(makeErrorURL(error_url, "missingExamSeriesCode"));
+ return HttpResponseRedirect(makeErrorURL(error_url, "missingPartnerID"));
exam_series_code = request.POST.get('vueExamSeriesCode')
# special case for supporting test user:
if client_candidate_id == "edX003671291147" and exam_series_code != '6002x001':
@@ -1188,7 +1190,7 @@ def test_center_login(request):
# this information is correct, we allow the user to be logged in
# without a password. This could all be formalized in a backend object
# that does the above checking.
- # TODO: create a backend class to do this.
+ # TODO: (brian) create a backend class to do this.
# testcenteruser.user.backend = "%s.%s" % (backend.__module__, backend.__class__.__name__)
testcenteruser.user.backend = "%s.%s" % ("TestcenterAuthenticationModule", "TestcenterAuthenticationClass")
login(request, testcenteruser.user)
diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py
index 78c986a963..ad084bdaf7 100644
--- a/common/lib/capa/capa/responsetypes.py
+++ b/common/lib/capa/capa/responsetypes.py
@@ -999,7 +999,7 @@ def sympy_check2():
self.context['debug'] = self.system.DEBUG
# exec the check function
- if type(self.code) == str:
+ if isinstance(self.code, basestring):
try:
exec self.code in self.context['global_context'], self.context
correct = self.context['correct']
diff --git a/lms/lib/symmath/symmath_check.py b/lms/lib/symmath/symmath_check.py
index a3dec4aae5..d386ea6b06 100644
--- a/lms/lib/symmath/symmath_check.py
+++ b/lms/lib/symmath/symmath_check.py
@@ -238,8 +238,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
###### PMathML input ######
# convert mathml answer to formula
try:
- if dynamath:
- mmlans = dynamath[0]
+ mmlans = dynamath[0] if dynamath else None
except Exception, err:
mmlans = None
if not mmlans:
diff --git a/lms/templates/staff_problem_info.html b/lms/templates/staff_problem_info.html
index 61cda0c52b..9324445dd1 100644
--- a/lms/templates/staff_problem_info.html
+++ b/lms/templates/staff_problem_info.html
@@ -1,5 +1,6 @@
${module_content}
-%if edit_link:
+%if location.category in ['problem','video','html']:
+% if edit_link:
-% endif
+% endif
@@ -74,3 +75,5 @@ category = ${category | h}
'user': '${user}'
});
+%endif
+