@request_cached
def get_course_cohort_settings(course_key):
 try:
  course_cohort_settings = CourseCohortsSettings.objects.get(course_id=course_key)
 except CourseCohortsSettings.DoesNotExist:
  course = courses.get_course_by_id(course_key)
  course_cohort_settings = migrate_cohort_settings(course)
 return course_cohort_settings

@ request_cached def get_course_cohort_settings ( course_key ) : try : course_cohort_settings = CourseCohortsSettings . objects . get ( course_id = course_key ) except CourseCohortsSettings . DoesNotExist : course = courses . get_course_by_id ( course_key ) course_cohort_settings = migrate_cohort_settings ( course ) return course_cohort_settings
return cohort settings for a course .