|Reported by:||thibaultj||Owned by:||nobody|
|Severity:||Normal||Keywords:||auth, user, manager, usermanager|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In contrib.auth, the User class is affected a custom UserManager manager. I cannot find any clean way to override this manager, or to define a new one.
This is a problem in the following case: I created a middleware to manage acl. So in every request, I need to access request.user.profile.something. I'd like to override the get_query_set() method of the UserManager, to use select_related().
The only possible solution seems to monkey patch user class in a middleware, as suggested here :