Skip to content

Commit

Permalink
Fix enabling multiple languages if the APP_NAME in the db was "Arch…
Browse files Browse the repository at this point in the history
…es" #11660 (#11687)

* Use same guard for "last" project as project-level urls.py #11660

This check sniffs for whether this urls.py is the one being run as a project
(not included by any further apps). For core arches, this would only be true
if running core arches without a project. This was failing on a Django exception
inside i18n_patterns().

This check is the same check that we're using in project-level settings.py

* Also avoid checking APP_NAME in generate_frontend_configuration()
  • Loading branch information
jacobtylerwalls authored Dec 19, 2024
1 parent 45bfcb8 commit fd21901
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion arches/settings_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def generate_frontend_configuration():
"WEBPACK_DEVELOPMENT_SERVER_PORT": settings.WEBPACK_DEVELOPMENT_SERVER_PORT,
}

if settings.APP_NAME == "Arches":
if str(Path(app_root_path).parent) == root_dir_path:
# Running core arches directly without a project, e.g.:
# app_root_path: arches/app
# root_dir_path: arches
base_path = root_dir_path
else:
base_path = app_root_path
Expand Down
2 changes: 1 addition & 1 deletion arches/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@

# This must be included in core to keep webpack happy, but cannot be appended when running a project.
# See https://github.com/archesproject/arches/pull/10754
if settings.APP_NAME == "Arches":
if settings.ROOT_URLCONF == __name__:
if settings.SHOW_LANGUAGE_SWITCH is True:
urlpatterns = i18n_patterns(*urlpatterns)

Expand Down
1 change: 1 addition & 0 deletions releases/7.6.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Fix regression where Arches is no longer overriding Django admin templates #[11668](https://github.com/archesproject/arches/issues/11668)
- Fix bug causing app resources with symlink in their path to not resolve #[11689](https://github.com/archesproject/arches/issues/11689)
- Fix bug causing the Edit button to not display in the map popup #[11679](https://github.com/archesproject/arches/issues/11679)
- Fix enabling multiple languages if the `APP_NAME` system settings tile had never been updated #[11660](https://github.com/archesproject/arches/issues/11660)

### Dependency changes:

Expand Down

0 comments on commit fd21901

Please sign in to comment.