'Save a snapshot of access rules for a course.
Arguments:
restricted_course (RestrictedCourse)
Keyword Arguments:
deleted (boolean): If True, the restricted course
is about to be deleted.  Create a placeholder
snapshot recording that the course and all its
rules was deleted.
Returns:
None'

@classmethod
def save_snapshot(cls, restricted_course, deleted=False):

    course_key = restricted_course.course_key
    snapshot = (CourseAccessRuleHistory.DELETED_PLACEHOLDER if deleted else json.dumps(restricted_course.snapshot()))
    cls.objects.create(course_key=course_key, snapshot=snapshot)
