Ability to hide Pages from students

This commit is contained in:
Dmitry Viskov
2016-07-01 14:28:06 +03:00
parent 0928cfde80
commit bb09fdb7be
8 changed files with 77 additions and 6 deletions

View File

@@ -546,9 +546,16 @@ def _save_xblock(user, xblock, data=None, children_strings=None, metadata=None,
# find the course's reference to this tab and update the name.
static_tab = CourseTabList.get_tab_by_slug(course.tabs, xblock.location.name)
# only update if changed
if static_tab and static_tab['name'] != xblock.display_name:
static_tab['name'] = xblock.display_name
store.update_item(course, user.id)
if static_tab:
update_tab = False
if static_tab['name'] != xblock.display_name:
static_tab['name'] = xblock.display_name
update_tab = True
if static_tab['course_staff_only'] != xblock.course_staff_only:
static_tab['course_staff_only'] = xblock.course_staff_only
update_tab = True
if update_tab:
store.update_item(course, user.id)
result = {
'id': unicode(xblock.location),