Merge pull request #18063 from edx/efischer/cache_partitions
Cache list of course partitions
This commit is contained in:
@@ -7,6 +7,7 @@ from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
import logging
|
||||
|
||||
from openedx.core.djangoapps.request_cache.middleware import request_cached
|
||||
from xmodule.partitions.partitions import UserPartition, UserPartitionError, ENROLLMENT_TRACK_PARTITION_ID
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -16,6 +17,7 @@ log = logging.getLogger(__name__)
|
||||
FEATURES = getattr(settings, 'FEATURES', {})
|
||||
|
||||
|
||||
@request_cached
|
||||
def get_all_partitions_for_course(course, active_only=False):
|
||||
"""
|
||||
A method that returns all `UserPartitions` associated with a course, as a List.
|
||||
|
||||
Reference in New Issue
Block a user