mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Corrected attribute access on for get_by_natural_key
This commit is contained in:
@@ -165,7 +165,7 @@ class BaseUserManager(models.Manager):
|
|||||||
return get_random_string(length, allowed_chars)
|
return get_random_string(length, allowed_chars)
|
||||||
|
|
||||||
def get_by_natural_key(self, username):
|
def get_by_natural_key(self, username):
|
||||||
return self.get(**{getattr(self, 'USERNAME_FIELD', 'username'): username})
|
return self.get(**{getattr(self.model, 'USERNAME_FIELD', 'username'): username})
|
||||||
|
|
||||||
|
|
||||||
class UserManager(BaseUserManager):
|
class UserManager(BaseUserManager):
|
||||||
|
|||||||
Reference in New Issue
Block a user