From 74f887f79af01a234b5a0426c843db5d5fda8b0e Mon Sep 17 00:00:00 2001 From: Johnathan Clementi Date: Wed, 12 Jun 2024 12:54:12 -0400 Subject: [PATCH] add missing config for upgrade to 7.6 --- arches_lingo/urls.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arches_lingo/urls.py b/arches_lingo/urls.py index cdd0a237..6c52ba91 100644 --- a/arches_lingo/urls.py +++ b/arches_lingo/urls.py @@ -6,9 +6,17 @@ from arches_lingo.views import ConceptTreeView urlpatterns = [ - path('', include('arches.urls')), + path("", include("arches.urls")), path("concept_trees/", ConceptTreeView.as_view(), name="concept_trees"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -# if settings.SHOW_LANGUAGE_SWITCH is True: -# urlpatterns = i18n_patterns(*urlpatterns) +# Only handle i18n routing in active project. This will still handle the routes provided by Arches core and Arches applications, +# but handling i18n routes in multiple places causes application errors. +if ( + settings.APP_NAME != "Arches" + and settings.APP_NAME not in settings.ARCHES_APPLICATIONS +): + if settings.SHOW_LANGUAGE_SWITCH is True: + urlpatterns = i18n_patterns(*urlpatterns) + + urlpatterns.append(path("i18n/", include("django.conf.urls.i18n")))