'Save the CourseMode objects to the database.'

@transaction.atomic
def save(self, *args, **kwargs):

    VerificationDeadline.set_deadline(self.id, self.verification_deadline, is_explicit=True)
    for mode in self.modes:
        mode.course_id = self.id
        mode.mode_display_name = self.get_mode_display_name(mode)
        mode.save()
    deleted_mode_ids = [mode.id for mode in self._deleted_modes]
    CourseMode.objects.filter(id__in=deleted_mode_ids).delete()
    self._deleted_modes = []
