Skip to content

Commit

Permalink
docs: add in-line docs for dynamic partitions modification
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Mar 15, 2024
1 parent 824a8ac commit 11d77c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xmodule/partitions/partitions_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def _get_dynamic_partitions(course):
for generator in dynamic_partition_generators:
generated_partition = generator(course)
if generated_partition:
# If the generator returns a list of partitions, add them all to the list.
# Otherwise, just add the single partition. This is needed for cases where
# a single generator can return multiple partitions, such as the TeamUserPartition.
if isinstance(generated_partition, list):
generated_partitions.extend(generated_partition)
else:
Expand Down

0 comments on commit 11d77c4

Please sign in to comment.