Skip to content

Commit 9ba55ce

Browse files
refactor: move installed apps configuration to common settings
1 parent 2cfc3dd commit 9ba55ce

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

openedx_authz/apps.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,5 @@ class OpenedxAuthzConfig(AppConfig):
4545
def ready(self):
4646
"""Initialization layer for the openedx_authz app."""
4747
# Initialize the enforcer to ensure it's ready when the app starts
48-
casbin_adapter_app = "casbin_adapter.apps.CasbinAdapterConfig"
49-
if casbin_adapter_app not in settings.INSTALLED_APPS:
50-
settings.INSTALLED_APPS.append(casbin_adapter_app)
5148
from openedx_authz.engine.enforcer import AuthzEnforcer
5249
AuthzEnforcer()

openedx_authz/settings/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def plugin_settings(settings):
1717
settings: The Django settings object
1818
"""
1919
# Add external third-party apps to INSTALLED_APPS
20-
20+
casbin_adapter_app = "casbin_adapter.apps.CasbinAdapterConfig"
21+
if casbin_adapter_app not in settings.INSTALLED_APPS:
22+
settings.INSTALLED_APPS.append(casbin_adapter_app)
2123
# Add Casbin configuration
2224
settings.CASBIN_MODEL = os.path.join(
2325
ROOT_DIRECTORY, "engine", "config", "model.conf"

0 commit comments

Comments
 (0)