﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35898	Cannot use base managers of related models in dumpdata command	Lorenzo Martini		"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 custom 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!"	New feature	closed	Core (Serialization)	5.1	Normal	wontfix	dumpdata chunk_size iterator prefetch_related user base_manager default_manager	Lorenzo Martini	Unreviewed	0	0	0	0	0	0
