From 1cd54d5fb70dbdf49430ee9b937e5e06f02a9471 Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 14 Apr 2016 16:38:34 -0400 Subject: [PATCH] Rename "is_default_cohort" method. --- lms/djangoapps/verified_track_content/models.py | 2 +- openedx/core/djangoapps/course_groups/cohorts.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/verified_track_content/models.py b/lms/djangoapps/verified_track_content/models.py index 44cc0827d8..5bf3b2271d 100644 --- a/lms/djangoapps/verified_track_content/models.py +++ b/lms/djangoapps/verified_track_content/models.py @@ -12,7 +12,7 @@ from courseware.courses import get_course_by_id from verified_track_content.tasks import sync_cohort_with_mode from openedx.core.djangoapps.course_groups.cohorts import ( - get_course_cohorts, CourseCohort, is_course_cohorted, get_random_cohort, is_default_cohort + get_course_cohorts, CourseCohort, is_course_cohorted, get_random_cohort ) import logging diff --git a/openedx/core/djangoapps/course_groups/cohorts.py b/openedx/core/djangoapps/course_groups/cohorts.py index 128acac876..4f0d5e229d 100644 --- a/openedx/core/djangoapps/course_groups/cohorts.py +++ b/openedx/core/djangoapps/course_groups/cohorts.py @@ -430,7 +430,7 @@ def set_assignment_type(user_group, assignment_type): """ course_cohort = user_group.cohort - if is_default_cohort(user_group) and course_cohort.assignment_type != assignment_type: + if is_last_random_cohort(user_group) and course_cohort.assignment_type != assignment_type: raise ValueError(_("There must be one cohort to which students can automatically be assigned.")) course_cohort.assignment_type = assignment_type @@ -445,9 +445,9 @@ def get_assignment_type(user_group): return course_cohort.assignment_type -def is_default_cohort(user_group): +def is_last_random_cohort(user_group): """ - Check if a cohort is default. + Check if this cohort is the only random cohort in the course. """ random_cohorts = CourseUserGroup.objects.filter( course_id=user_group.course_id,