#23017 closed Bug (invalid)

Default Managers

Reported by: rbatukaev@… 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 Changed 14 months ago by rbatukaev@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Custom Managers to Default Managers

comment:2 Changed 14 months ago by timo

  • Resolution set to invalid
  • Status changed from new to closed

The default manager should inherit from BaseUserManager or implement its methods.

Note: See TracTickets for help on using tickets.
Back to Top