Remove the INSTALLED_APPS setting

The INSTALLED APPS setting is now replaced by the
new COMMON_EXTRA_APPS and COMMON_DISABLED_APPS.

Exposing the INSTALLED_APPS setting had the side effect
of blocking new apps that were added in new versions.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-06-28 23:26:29 -04:00
parent f8f6700459
commit d0daf559c7
4 changed files with 35 additions and 10 deletions

View File

@@ -18,6 +18,8 @@
existing tags.
* Add proper redirection after moving a document to the
trash.
* Remove the INSTALLED_APPS setting. Replace it with
the new COMMON_EXTRA_APPS and COMMON_DISABLED_APPS.
3.2.3 (2019-06-21)
==================

View File

@@ -26,6 +26,8 @@ Changes
existing tags.
- Add proper redirection after moving a document to the
trash.
- Remove the INSTALLED_APPS setting. Replace it with
the new COMMON_EXTRA_APPS and COMMON_DISABLED_APPS.
Removals
--------

View File

@@ -26,6 +26,26 @@ settings_db_sync_task_delay = namespace.add_setting(
'propagate.'
)
)
setting_disabled_apps = namespace.add_setting(
global_name='COMMON_DISABLED_APPS',
default=settings.COMMON_DISABLED_APPS,
help_text=_(
'A list of strings designating all applications that are to be removed '
'from the list normally installed by Mayan EDMS. Each string should be '
'a dotted Python path to: an application configuration class (preferred), '
'or a package containing an application.'
),
)
setting_extra_apps = namespace.add_setting(
global_name='COMMON_EXTRA_APPS',
default=settings.COMMON_EXTRA_APPS,
help_text=_(
'A list of strings designating all applications that are installed '
'beyond those normally installed by Mayan EDMS. Each string should be '
'a dotted Python path to: an application configuration class (preferred), '
'or a package containing an application.'
),
)
setting_home_view = namespace.add_setting(
global_name='COMMON_HOME_VIEW',
default=DEFAULT_COMMON_HOME_VIEW, help_text=_(
@@ -254,16 +274,6 @@ setting_django_file_upload_max_memory_size = namespace.add_setting(
'DATA_UPLOAD_MAX_MEMORY_SIZE.'
),
)
setting_django_installed_apps = namespace.add_setting(
global_name='INSTALLED_APPS',
default=settings.INSTALLED_APPS,
help_text=_(
'A list of strings designating all applications that are enabled '
'in this Django installation. Each string should be a dotted '
'Python path to: an application configuration class (preferred), '
'or a package containing an application.'
),
)
setting_django_login_url = namespace.add_setting(
global_name='LOGIN_URL',
default=settings.LOGIN_URL,

View File

@@ -360,6 +360,8 @@ else:
BASE_INSTALLED_APPS = INSTALLED_APPS
COMMON_EXTRA_APPS = ()
COMMON_DISABLED_APPS = ()
CONFIGURATION_FILEPATH = os.path.join(MEDIA_ROOT, CONFIGURATION_FILENAME)
CONFIGURATION_LAST_GOOD_FILEPATH = os.path.join(
@@ -378,3 +380,12 @@ for app in INSTALLED_APPS:
'Update the app references in the file config.yml as detailed '
'in https://docs.mayan-edms.com/releases/3.2.html#backward-incompatible-changes'
)
for APP in COMMON_EXTRA_APPS:
INSTALLED_APPS = INSTALLED_APPS + (APP,)
INSTALLED_APPS = [
APP for APP in INSTALLED_APPS if APP not in COMMON_DISABLED_APPS
]