Commit 4360c50d by Jesse Shapiro Committed by GitHub

Merge pull request #13252 from felipevolpone/master

Disable the "View Unit in Studio" button in CCX courses
parents cd20c709 14f1fdf3
......@@ -40,3 +40,9 @@ class CoachDashboardPage(CoursePage):
lambda: self.q(css=create_ccx_button).present, "Create a new Custom Course for edX"
).fulfill()
self.q(css=create_ccx_button).click()
def is_button_view_unit_in_studio_visible(self):
"""
check if the View Unit in Studio button is on the page
"""
return self.q(css='instructor-info-action').present
......@@ -56,3 +56,7 @@ class CreateCCXCoachTest(EventsTestMixin, UniqueCourseTest):
# Assert that new ccx is created and we are on ccx dashboard/enrollment tab.
self.assertTrue(self.coach_dashboard_page.is_browser_on_enrollment_page())
# Assert that the user cannot click in the "View Unit in Studio" button,
# which means the user cannot edit the ccx course in studio
self.assertFalse(self.coach_dashboard_page.is_button_view_unit_in_studio_visible())
......@@ -88,6 +88,12 @@ def get_override_for_ccx(ccx, block, name, default=None):
clean_ccx_key = _clean_ccx_key(block.location)
block_overrides = overrides.get(clean_ccx_key, {})
# Hardcode the course_edit_method to be None instead of 'Studio', so,
# the LMS never tries to link back to Studio. CCX courses
# can't be edited in Studio.
block_overrides['course_edit_method'] = None
if name in block_overrides:
try:
return block.fields[name].from_json(block_overrides[name])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment