From 726c5cfa6758da0b898f3c9c452c4cff8fa66086 Mon Sep 17 00:00:00 2001 From: Christopher Byrd Date: Thu, 12 Dec 2024 13:43:58 -0800 Subject: [PATCH] fixes arches-level template overrides #11668 (#11686) * fixes arches-level template overrides #11668 --- arches/settings_utils.py | 9 ++++++++- releases/7.6.4.md | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arches/settings_utils.py b/arches/settings_utils.py index d8ceb934996..b3df5b45d6e 100644 --- a/arches/settings_utils.py +++ b/arches/settings_utils.py @@ -1,8 +1,8 @@ import json import os +from pathlib import Path import site import sys -from contextlib import contextmanager from django.apps import apps from django.conf import settings @@ -96,13 +96,20 @@ def build_templates_config( """ directories = [] try: + # allows for manual additions to template overrides if additional_directories: for additional_directory in additional_directories: directories.append(additional_directory) + # allows for application-level overrides of generic Django templates if app_root: directories.append(os.path.join(app_root, "templates")) + # forces Arches-level overrides of generic Django templates + directories.append( + os.path.join(Path(__file__).resolve().parent, "app", "templates") + ) + return [ { "BACKEND": "django.template.backends.django.DjangoTemplates", diff --git a/releases/7.6.4.md b/releases/7.6.4.md index 50fa6b137f1..aa8d0877369 100644 --- a/releases/7.6.4.md +++ b/releases/7.6.4.md @@ -2,11 +2,12 @@ ### Bug Fixes and Enhancements -- Remove unnecessary creation of guardian permissions for principal user #[11564](https://github.com/archesproject/arches/issues/11564) +- Remove unnecessary creation of guardian permissions for principal user #[11564](https://github.com/archesproject/arches/issues/11564) - Fix migration that sets the initial principal users if a user no longer exists #[11664](https://github.com/archesproject/arches/issues/11664) -- Fix Graph Designer failure when editing large graphs #[11615](https://github.com/archesproject/arches/issues/11615) -- Fix failure to download exported search results when using non file-system based storages #[11620](https://github.com/archesproject/arches/issues/11620) +- Fix Graph Designer failure when editing large graphs #[11615](https://github.com/archesproject/arches/issues/11615) +- Fix failure to download exported search results when using non file-system based storages #[11620](https://github.com/archesproject/arches/issues/11620) - Cache resource relationship preflabels to improve report load time #[11583](https://github.com/archesproject/arches/issues/11583) +- Fix regression where Arches is no longer overriding Django admin templates #[11668](https://github.com/archesproject/arches/issues/11668) - Fix bug causing the Edit button to not display in the map popup #[11679](https://github.com/archesproject/arches/issues/11679) ### Dependency changes: