summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorhesham942 <heshamhatem2004@gmail.com>2025-03-14 15:16:38 +0200
committernessita <124304+nessita@users.noreply.github.com>2025-03-17 16:29:28 -0300
commite804a07d76fc85468f27f7130ae1442fabcd650d (patch)
treede53ecf30cf4f5bceccbfdfaba4aa06f91218982 /django/core
parent1823a8011346afc280e0efaf8cb7c086b148f881 (diff)
Fixed #36252 -- Handled duplicate automatic imports in the shell command.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management/commands/shell.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py
index 89d12ce6b8..132e7f89d2 100644
--- a/django/core/management/commands/shell.py
+++ b/django/core/management/commands/shell.py
@@ -185,8 +185,8 @@ class Command(BaseCommand):
else:
module = None
name = path
-
- auto_imports[module].append((name, obj))
+ if (name, obj) not in auto_imports[module]:
+ auto_imports[module].append((name, obj))
namespace = {
name: obj for items in auto_imports.values() for name, obj in items