Custom User model, wrong field order in Django admin form
|Reported by:||Dylan Verheul||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Create a Custom user that just adds a few fields. Do this by inheriting django.contrib.auth.models.AbstractUser
Here is my code:
class User(AbstractUser): is_admin = models.BooleanField(default=False, verbose_name=ugettext_lazy('is admin')) hide_name = models.BooleanField(default=False, verbose_name=ugettext_lazy('hide name')) country = models.ForeignKey(Country, null=True, blank=True, verbose_name=ugettext_lazy('country')) language = LanguageField(null=True, blank=True) share_photos = models.BooleanField(default=True, verbose_name=ugettext_lazy('share photo\'s with other users'))
when adding/editing a user in the Django admin, I would expect to see the standard User fields in the same order as when using django.contrib.auth.models.User, and my own (added) fields below them).
Instead, the inherited fields are in an order tha makes no sense, starting with password. See screenshot.