fix: Passing unsaved model instances to related filters is no longer … (#37227)
* fix: Passing unsaved model instances to related filters is no longer allowed.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user