diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-06-23 20:22:59 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-06-23 20:24:24 +0200 |
| commit | b37a4affcd0e28ed9266e96c04ceadd2b3396aea (patch) | |
| tree | f5ed325eda33b58a273285949ae4a46043b40bdf /django | |
| parent | 531c96de34d746a58b9b7320378296730312c016 (diff) | |
[4.1.x] Fixed #33800 -- Fixed system check for the same template tag module in installed apps and template tag libraries.
Thanks Claude Paroz for the report.
Regression in 004b4620f6f4ad87261e149898940f2dcd5757ef.
Backport of 083bfca6b6c00d0f45837a65c2db721eaf46bc07 from main
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/checks/templates.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/core/checks/templates.py b/django/core/checks/templates.py index 5214276987..692ec98203 100644 --- a/django/core/checks/templates.py +++ b/django/core/checks/templates.py @@ -50,15 +50,15 @@ def check_string_if_invalid_is_string(app_configs, **kwargs): @register(Tags.templates) def check_for_template_tags_with_the_same_name(app_configs, **kwargs): errors = [] - libraries = defaultdict(list) + libraries = defaultdict(set) for conf in settings.TEMPLATES: custom_libraries = conf.get("OPTIONS", {}).get("libraries", {}) for module_name, module_path in custom_libraries.items(): - libraries[module_name].append(module_path) + libraries[module_name].add(module_path) for module_name, module_path in get_template_tag_modules(): - libraries[module_name].append(module_path) + libraries[module_name].add(module_path) for library_name, items in libraries.items(): if len(items) > 1: @@ -66,7 +66,7 @@ def check_for_template_tags_with_the_same_name(app_configs, **kwargs): Error( E003.msg.format( repr(library_name), - ", ".join(repr(item) for item in items), + ", ".join(repr(item) for item in sorted(items)), ), id=E003.id, ) |
