Yes, of course, Ken, thanks, I went this way. I created a user model from AbstractBaseUser and rewrote UserManager. I don’t really care (in this particular project) the admin’s functions, since the project does not imply its presence in its usual form; not at the production stage, not at the debugging stage.
Thanks again. I will only note that very often our colleagues proceed from two convenient for them, but philosophically incorrect postulates. First: “it was like that before us and it happened historically.” Second: “if it works, then don’t touch it!” These two rules are good if there is no possibility or no ability to think in abstractions. Therefore, from project to project, we see unnormalized tables and classes, attributes and fields that do not correspond to the object or class, and just a “crooked” code. This is an eternal struggle between the Simple and the Right, as Rowling wrote.
Think about it, if we started with a clean slate, what would we need to make a superuser stand out? You can even skip creating the “is_superuser” field, since in 99% of cases the first user in the database is an administrator. In other words, the task of rights and access to the admin site can be solved more elegantly.
And in business logic, the “is_staff” field is an attribute of another entity. Moreover, this is not an attribute at all, it is a link (ManyToMany) between the Person class and, for example, Profile, Position or Role, or Organization class, and etc. Exactly like the User is correlated with the Person by the OneToOne. This is what I meant. Likewise, admin access is owned by the group.
The task of assigning rights is quite different, thanks for your clarification. But as they say in consulting, if the client did not understand something, this does not mean that the client is a fool, it means that the consultant explained poorly. And at least in the fact that the name of the field was not chosen well (I do not use keywords for variables), I think I’m still right.
Thank you for your feedback. Thank you for participating. All the best to you!