Registering abstract model with admin gives confusing / misleading error
|Reported by:||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
It makes perfect sense that an abstract model cannot be registered with admin. However, the abstract model is listed with the rest and there is no error until the page for that model is requested from the admin interface. Doing so gives:
'str' object has no attribute '_default_manager'
This is a bit mysterious, and IMO would be better handled at the time of registering the model with something more explicit. Also, since this error occurs in some other hard-to-identify cases (see #10405, among others), I spent a lot of time going down blind alleys in search of the source of the problem.
Change History (9)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|