﻿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
19069	improve error when attempting to use a swapped model	Preston Holmes	nobody	"Currently two checks for a swapped model exist when creating a manager:

* https://github.com/django/django/blob/3b6f980bedbbf091fe29bececa2b262d2084ce4d/django/db/models/manager.py#L16
* https://github.com/django/django/blob/3b6f980bedbbf091fe29bececa2b262d2084ce4d/django/db/models/manager.py#L61

These result in an error:


{{{AttributeError: type object 'User' has no attribute 'objects'}}} 

as opposed to {{{DatabaseError: no such table: <...>}}} which is the error when the model is swapped but has the default manager (as syncdb will not create tables for swapped models).  Ideally - there should be a manager installed that just raises an error explaining that the model has been swapped and is unavailable and probably offer information about what model it was swapped for - as this is readily available.
"	Cleanup/optimization	closed	Database layer (models, ORM)	1.4	Normal	fixed			Unreviewed	0	0	0	0	0	0
