Skip to content
Open
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions cms/djangoapps/contentstore/toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,3 +773,26 @@ def enable_outline_component_creation(course_key):
Returns a boolean if the Add Component in Outline feature is enabled for the given course.
"""
return ENABLE_OUTLINE_COMPONENT_CREATION.is_enabled(course_key)


# .. toggle_name: contentstore.hard_cap_library_content_max_count
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: When enabled for a course (or org), Studio treats library_content /
# itembank max_count values above LIBRARY_CONTENT_MAX_COUNT_WARNING_THRESHOLD as a
# validation ERROR instead of a WARNING. Publish is still not blocked by the platform
# by default; this strengthens author-facing messaging for orgs that want a hard stance.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2026-08-06
HARD_CAP_LIBRARY_CONTENT_MAX_COUNT = CourseWaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.hard_cap_library_content_max_count',
__name__,
CONTENTSTORE_LOG_PREFIX,
)


def hard_cap_library_content_max_count(course_key):
"""
Return True if large library/item-bank max_count should surface as an ERROR in Studio.
"""
return HARD_CAP_LIBRARY_CONTENT_MAX_COUNT.is_enabled(course_key)
11 changes: 11 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,17 @@
######################## Setting for content libraries ########################
MAX_BLOCKS_PER_CONTENT_LIBRARY = 100_000

# Studio warning when Randomized Content / Item Bank "Count" (max_count) exceeds this.
# Default 25; publish remains allowed (WARNING). Optional course waffle escalates to ERROR:
# contentstore.hard_cap_library_content_max_count
# .. setting_name: LIBRARY_CONTENT_MAX_COUNT_WARNING_THRESHOLD
# .. setting_default: 25
# .. setting_description: Threshold for Studio validation when library_content / itembank
# max_count is high enough to risk slow learner loads.
LIBRARY_CONTENT_MAX_COUNT_WARNING_THRESHOLD = 25
# Optional URL appended to the Studio warning (internal runbook). Empty = omit link text.
LIBRARY_CONTENT_LARGE_MAX_COUNT_HELP_URL = ''

######################## Organizations ########################

# .. toggle_name: ORGANIZATIONS_AUTOCREATE
Expand Down
Loading
Loading