#35898: dumpdata Command Fails on Model with Custom User Manager
-------------------------------------+-------------------------------------
Reporter: Lorenzo Martini | Type: Bug
Status: new | Component: Core
| (Serialization)
Version: 5.1 | Severity: Normal
Keywords: dumpdata chunk_size | Triage Stage:
iterator prefetch_related user | Unreviewed
base_manager default_manager |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Hello Django Team,
I'm encountering an issue with the django-admin dumpdata command when
trying to serialize a model with a ManyToMany relationship to a custom
User model. This custom User model inherits from another User model
defined in a different app.
It appears that Django is using the default manager of the custom User
model, rather than its base manager. This base manager includes
prefetch_related calls in its get_queryset function, which I suspect is
causing the issue.
I've attached a Dockerized Django app that replicates this behavior. You
can also find it on GitHub: https://github.com/Martini991/django-dumpdata-
bug.
For reference, I’ve reviewed two related tickets, but they seem to address
different issues:
https://code.djangoproject.com/ticket/35238
https://code.djangoproject.com/ticket/35159
Thank you for your assistance!
--
Ticket URL: <https://code.djangoproject.com/ticket/35898>
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/010701930af5d59f-3baab24e-bb16-4f4a-ac5e-ff146ec68639-000000%40eu-central-1.amazonses.com.