Merge pull request #19642 from cpennington/fbe-improve-course-api-performance
Allow courses api to return data incrementally
This commit is contained in:
@@ -22,6 +22,7 @@ import crum
|
||||
from config_models.models import ConfigurationModel, cache
|
||||
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
||||
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
|
||||
from openedx.core.lib.cache_utils import request_cached
|
||||
|
||||
|
||||
class Provenance(Enum):
|
||||
@@ -252,7 +253,9 @@ class StackedConfigurationModel(ConfigurationModel):
|
||||
return course_key.org
|
||||
|
||||
@classmethod
|
||||
@request_cached()
|
||||
def _site_from_org(cls, org):
|
||||
|
||||
configuration = SiteConfiguration.get_configuration_for_org(org, select_related=['site'])
|
||||
if configuration is None:
|
||||
try:
|
||||
|
||||
@@ -409,7 +409,8 @@ class CourseOverview(TimeStampedModel):
|
||||
migrate and test switching to display_name_with_default, which is no
|
||||
longer escaped.
|
||||
"""
|
||||
return block_metadata_utils.display_name_with_default_escaped(self)
|
||||
# pylint: disable=line-too-long
|
||||
return block_metadata_utils.display_name_with_default_escaped(self) # xss-lint: disable=python-deprecated-display-name
|
||||
|
||||
@property
|
||||
def dashboard_start_display(self):
|
||||
@@ -560,7 +561,7 @@ class CourseOverview(TimeStampedModel):
|
||||
@classmethod
|
||||
def get_all_courses(cls, orgs=None, filter_=None):
|
||||
"""
|
||||
Returns all CourseOverview objects in the database.
|
||||
Return a queryset containing all CourseOverview objects in the database.
|
||||
|
||||
Arguments:
|
||||
orgs (list[string]): Optional parameter that allows case-insensitive
|
||||
|
||||
Reference in New Issue
Block a user