Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions openedx/core/djangoapps/course_groups/cohorts.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ def get_group_info_for_cohort(cohort, use_cached=False):
use_cached=True to use the cached value instead of fetching from the
database.
"""
if cohort.pk is None:
# Cohort not saved yet, so no PartitionGroup can be linked to it.
return (None, None)

cache = RequestCache("cohorts.get_group_info_for_cohort").data
cache_key = str(cohort.id)

Expand Down
Loading