[5.2.x] Fixed #36252 -- Handled duplicate automatic imports in the shell command.

Backport of e804a07d76 from main.
This commit is contained in:
hesham942 2025-03-14 15:16:38 +02:00 committed by Natalia
parent 181280027d
commit 1d8696bfc6
3 changed files with 9 additions and 3 deletions

View file

@ -55,7 +55,8 @@ Running this customized ``shell`` command with ``verbosity=2`` would show:
from django.urls import resolve, reverse
If an overridden ``shell`` command includes paths that cannot be imported,
these errors are shown when ``verbosity`` is set to ``1`` or higher.
these errors are shown when ``verbosity`` is set to ``1`` or higher. Duplicate
imports are automatically handled.
Note that automatic imports can be disabled for a specific ``shell`` session
using the :option:`--no-imports <shell --no-imports>` flag. To permanently