From 727fe78d8b517b904b95dd7271c22bd720f872e0 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 14 Jun 2019 02:16:37 -0400 Subject: [PATCH] Add check for app references Point users to release notes for details when app references are not updated. GitLab issue #603. Thanks to Vikas Kedia (@vikaskedia) for the report. Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ docs/releases/3.2.1.rst | 2 ++ mayan/settings/base.py | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 71b8464bb9..44350cd130 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,8 @@ * Use YAML SafeDumper to avoid adding YAML datatype tags. Closes GitLab issue #599. Thanks to Frédéric Sheedy (@fsheedy) for the report and debug information. +* Add check for app references and point users to release notes for details. + GitLab issue #603. Thanks to Vikas Kedia (@vikaskedia) for the report. 3.2 (2019-06-13) ================ diff --git a/docs/releases/3.2.1.rst b/docs/releases/3.2.1.rst index b598fbd408..717c4be86e 100644 --- a/docs/releases/3.2.1.rst +++ b/docs/releases/3.2.1.rst @@ -15,6 +15,8 @@ Changes - Use YAML SafeDumper to avoid adding YAML datatype tags. Closes GitLab issue #599. Thanks to Frédéric Sheedy (@fsheedy) for the report and debug information. +- Add check for app references and point users to release notes for details. + GitLab issue #603. Thanks to Vikas Kedia (@vikaskedia) for the report. Removals diff --git a/mayan/settings/base.py b/mayan/settings/base.py index 9591f913a4..f2cd8f833b 100644 --- a/mayan/settings/base.py +++ b/mayan/settings/base.py @@ -14,6 +14,7 @@ from __future__ import unicode_literals import os import sys +from django.core.exceptions import ImproperlyConfigured from django.utils.translation import ugettext_lazy as _ import environ @@ -355,6 +356,9 @@ else: } } + +BASE_INSTALLED_APPS = INSTALLED_APPS + CONFIGURATION_FILEPATH = os.path.join(MEDIA_ROOT, CONFIGURATION_FILENAME) CONFIGURATION_LAST_GOOD_FILEPATH = os.path.join( MEDIA_ROOT, CONFIGURATION_LAST_GOOD_FILENAME @@ -364,3 +368,11 @@ if 'revertsettings' not in sys.argv: result = read_configuration_file(CONFIGURATION_FILEPATH) if result: globals().update(result) + + +for app in INSTALLED_APPS: + if 'mayan.apps.{}'.format(app) in BASE_INSTALLED_APPS: + raise ImproperlyConfigured( + 'Update the app references in the file config.yml as detailed ' + 'in https://docs.mayan-edms.com/releases/3.2.html#backward-incompatible-changes' + )