#36252: Duplicate Display of Imports in Django Shell
-------------------------------------+-------------------------------------
Reporter: Raffaella | Type: Bug
Status: new | Component: Core
| (Management commands)
Version: 5.2 | Severity: Normal
Keywords: shell | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
When customizing the automatic imports into the shell by adding the same
import twice:
{{{
from django.core.management.commands import shell
class Command(shell.Command):
def get_auto_imports(self):
return super().get_auto_imports() + [
"django.urls.reverse",
"django.urls.reverse",
]
}}}
After opening the shell, while the total number of imports is correct, the
`reverse` import is displayed twice in the output:
{{{
12 objects imported automatically:
from project.newsletter.models import SubscriptionNotification,
Subscription, Post, Category
from django.contrib.sessions.models import Session
from django.contrib.sites.models import Site
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User, Group, Permission
from django.contrib.admin.models import LogEntry
from django.urls import reverse, reverse
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36252>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/010701958c64c231-26988ba9-2263-4b9b-b9a3-e89d40fcd582-000000%40eu-central-1.amazonses.com.