From 9009a864f077f8078db9ed8ed851d942deed2826 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sun, 9 Jul 2023 19:02:58 +0200 Subject: [PATCH] As of django-filer 3.0 mptt is not needed as a dependency #224 (#226) * Update utils.py --------- Co-authored-by: Fabian Braun Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- app_helper/utils.py | 6 +++++- changes/225.bugfix | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changes/225.bugfix diff --git a/app_helper/utils.py b/app_helper/utils.py index f43e0de..7252629 100644 --- a/app_helper/utils.py +++ b/app_helper/utils.py @@ -238,7 +238,11 @@ def _make_settings(args, application, settings, STATIC_ROOT, MEDIA_ROOT): # NOQ if "treebeard" not in default_settings["INSTALLED_APPS"]: default_settings["INSTALLED_APPS"].append("treebeard") if "filer" in default_settings["INSTALLED_APPS"] and "mptt" not in default_settings["INSTALLED_APPS"]: - default_settings["INSTALLED_APPS"].append("mptt") + from filer import __version__ + + if __version__ < "3": + # As of django-filer 3.0 mptt is not needed as a dependency + default_settings["INSTALLED_APPS"].append("mptt") if "filer" in default_settings["INSTALLED_APPS"] and "easy_thumbnails" not in default_settings["INSTALLED_APPS"]: default_settings["INSTALLED_APPS"].append("easy_thumbnails") diff --git a/changes/225.bugfix b/changes/225.bugfix new file mode 100644 index 0000000..2628f00 --- /dev/null +++ b/changes/225.bugfix @@ -0,0 +1 @@ +Do not add mptt with django-filer 3+