Opened 10 years ago
Closed 10 years ago
#23017 closed Bug (invalid)
Default Managers
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.auth | Version: | 1.7-rc-1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When I do not define any managers, I get no errors. However, when I do the following:
class User(AbstractUser): # some fields objects = model.Manager() hstore_manager = hstore.HStoreManager()
I get
AttributeError at'Manager' object has no attribute 'get_by_natural_key'
There is something wrong with /django/contrib/auth/backends.py in authenticate method on this line:
user = UserModel._default_manager.get_by_natural_key(username)
Change History (2)
comment:1 by , 10 years ago
Summary: | Custom Managers → Default Managers |
---|
comment:2 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The default manager should inherit from BaseUserManager or implement its methods.