From 9e57dc8c7603765a0f7fe5c9bfdf0318d58faf81 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Tue, 24 Mar 2026 19:32:41 -0700 Subject: [PATCH] feat: remove enterprise and consent from OPTIONAL_APPS - Remove ('enterprise', None) and ('consent', None) from OPTIONAL_APPS in {lms,cms}/envs/common.py. Now that edx-enterprise registers enterprise and consent as openedx plugins via entry_points, get_plugin_apps() adds them to INSTALLED_APPS automatically. Keeping them in OPTIONAL_APPS would cause duplicate app label errors. - Update enterprise_enabled() in enterprise_support/api.py to use django_apps.is_installed('enterprise') instead of the raw string check 'enterprise' in settings.INSTALLED_APPS. The new plugin entry_point-based registration uses 'enterprise.apps.EnterpriseConfig' (not 'enterprise') in INSTALLED_APPS, so the raw string check no longer works. ENT-11663 Co-Authored-By: Claude Sonnet 4.6 --- cms/envs/common.py | 5 ++--- lms/envs/common.py | 5 ++--- openedx/features/enterprise_support/api.py | 3 ++- requirements/constraints.txt | 2 +- requirements/edx/base.txt | 2 +- requirements/edx/development.txt | 2 +- requirements/edx/doc.txt | 2 +- requirements/edx/testing.txt | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index 99db8900d3c4..3c33ea7a9ae8 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1300,9 +1300,8 @@ # edxval ('edxval', 'openedx.core.djangoapps.content.course_overviews.apps.CourseOverviewsConfig'), - # Enterprise App (http://github.com/openedx/edx-enterprise) - ('enterprise', None), - ('consent', None), + # Deprecated apps from the edx-enterprise package. We're working on removing these as part of + # pluginifying edx-enterprise () ('integrated_channels.integrated_channel', None), ('integrated_channels.degreed', None), ('integrated_channels.degreed2', None), diff --git a/lms/envs/common.py b/lms/envs/common.py index cb6cc78e9fb1..cc2a79121806 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2678,9 +2678,8 @@ # edxval ('edxval', 'openedx.core.djangoapps.content.course_overviews.apps.CourseOverviewsConfig'), - # Enterprise Apps (http://github.com/openedx/edx-enterprise) - ('enterprise', None), - ('consent', None), + # Deprecated apps from the edx-enterprise package. We're working on removing these as part of + # pluginifying edx-enterprise () ('integrated_channels.integrated_channel', None), ('integrated_channels.degreed', None), ('integrated_channels.degreed2', None), diff --git a/openedx/features/enterprise_support/api.py b/openedx/features/enterprise_support/api.py index 56e7b10eb5e4..442be226b54a 100644 --- a/openedx/features/enterprise_support/api.py +++ b/openedx/features/enterprise_support/api.py @@ -9,6 +9,7 @@ import requests from crum import get_current_request +from django.apps import apps as django_apps from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.contrib.sites.models import Site @@ -383,7 +384,7 @@ def enterprise_enabled(): """ Determines whether the Enterprise app is installed """ - return 'enterprise' in settings.INSTALLED_APPS and settings.FEATURES.get('ENABLE_ENTERPRISE_INTEGRATION', False) + return django_apps.is_installed('enterprise') and settings.FEATURES.get('ENABLE_ENTERPRISE_INTEGRATION', False) def enterprise_is_enabled(otherwise=None): diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 9d081a0d58d4..b74a704dc0ae 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -42,7 +42,7 @@ django-stubs<6 # The team that owns this package will manually bump this package rather than having it pulled in automatically. # This is to allow them to better control its deployment and to do it in a process that works better # for them. -edx-enterprise==6.7.0 +edx-enterprise==6.8.1 # Date: 2023-07-26 # Our legacy Sass code is incompatible with anything except this ancient libsass version. diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index bcfc514120cc..f983439a774a 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -473,7 +473,7 @@ edx-drf-extensions==10.6.0 # edxval # enterprise-integrated-channels # openedx-learning -edx-enterprise==6.7.0 +edx-enterprise==6.8.1 # via # -c requirements/constraints.txt # -r requirements/edx/kernel.in diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index e5bf827acf4c..2c297556d4b0 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -747,7 +747,7 @@ edx-drf-extensions==10.6.0 # edxval # enterprise-integrated-channels # openedx-learning -edx-enterprise==6.7.0 +edx-enterprise==6.8.1 # via # -c requirements/constraints.txt # -r requirements/edx/doc.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index a07e6875ee4c..efefed9d398f 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -557,7 +557,7 @@ edx-drf-extensions==10.6.0 # edxval # enterprise-integrated-channels # openedx-learning -edx-enterprise==6.7.0 +edx-enterprise==6.8.1 # via # -c requirements/constraints.txt # -r requirements/edx/base.txt diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index c39f2bd9ec39..868e91c0ba38 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -578,7 +578,7 @@ edx-drf-extensions==10.6.0 # edxval # enterprise-integrated-channels # openedx-learning -edx-enterprise==6.7.0 +edx-enterprise==6.8.1 # via # -c requirements/constraints.txt # -r requirements/edx/base.txt