Admin broken for subclasses of User
|Reported by:||Jim Garrison||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a model called
Teacher, which inherits from
Here's the story: the "Add Teacher" form in the admin uses the form typically used for editing a user, so you have to type in a fake password string for it to accept the new
Teacher. Further, the link to the "change password form" is broken.
Nothing I have said so far is new, however, as this is the subject of ticket #9656. This ticket was closed, saying that the person ought to be subclassing from
I am filing this ticket because such subclassing from
UserAdmin creates additional problems that are even worse than the above issues. In particular,
- If you submit the "Add Teacher" form, a
Useris created, but a corresponding
- After editing a
Teacher, it redirects to the edit page for "teacher/[id]/", except it uses the id from the
Usertable, not the
Teachertable. I have only been able to reproduce this using MySQL; sqlite does not give me this error.
In short, deriving from
UserAdmin currently creates more problems than it solves.