From 23b986283d2fd7afc8e18f5f51d803187d766e06 Mon Sep 17 00:00:00 2001 From: Markos Gogoulos Date: Wed, 6 May 2026 11:20:27 +0300 Subject: [PATCH] cat --- cms/settings.py | 5 +++++ cms/version.py | 2 +- files/views/categories.py | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cms/settings.py b/cms/settings.py index b36fe496..fe17d16d 100644 --- a/cms/settings.py +++ b/cms/settings.py @@ -668,3 +668,8 @@ if USE_LTI: # SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" # Consider using cached_db for reliability if sessions are lost between many LTI launches RELATED_MEDIA_STRATEGY = "no_related" + + # Whether LMS course categories (is_lms_course=True) appear in the public + # category list. Off by default — LMS courses are internal LTI constructs + # and are not meaningful to regular MediaCMS users. + SHOW_LMS_COURSES_IN_CATEGORIES = False diff --git a/cms/version.py b/cms/version.py index 6c966646..d69f8ef8 100644 --- a/cms/version.py +++ b/cms/version.py @@ -1 +1 @@ -VERSION = "8.0.1b" +VERSION = "8.0.1c" diff --git a/files/views/categories.py b/files/views/categories.py index 64cb8256..9c0993e5 100644 --- a/files/views/categories.py +++ b/files/views/categories.py @@ -36,6 +36,9 @@ class CategoryList(APIView): rbac_categories = request.user.get_rbac_categories_as_member() categories = categories.union(rbac_categories) + if not getattr(settings, 'SHOW_LMS_COURSES_IN_CATEGORIES', True): + categories = categories.filter(is_lms_course=False) + categories = categories.order_by("title") serializer = CategorySerializer(categories, many=True, context={"request": request})