From 1edec85c3a0b13ccd0a25f1e7bb9dc416e93c2dc Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 1 Jul 2025 12:54:50 +0300 Subject: [PATCH] Features: 1) None; Fixes: 1) Correct handling of the Select2 i18n file path in admin media to prevent issues with optional language files; Extra: 1) Minor refactoring to streamline JavaScript file list construction. --- core/admin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/admin.py b/core/admin.py index d9e6e0a0..202fc6e4 100644 --- a/core/admin.py +++ b/core/admin.py @@ -275,7 +275,6 @@ class ProductAdmin(FieldsetsMixin, BasicModelAdmin): @property def media(self): i18n_name = get_select2_language() - i18n_file = (f"vendor/select2/i18n/{i18n_name}.js",) if i18n_name else () extra = "" if settings.DEBUG else ".min" js = [ f"vendor/jquery/jquery{extra}.js", @@ -288,7 +287,7 @@ class ProductAdmin(FieldsetsMixin, BasicModelAdmin): f"vendor/xregexp/xregexp{extra}.js", "vendor/jquery/jquery.min.js", "vendor/select2/select2.full.min.js", - *i18n_file, + f"vendor/select2/i18n/{i18n_name}.js" if i18n_name else (), "jquery.init.js", "django_admin_list_filter.js", ]