Improve typing information.

This commit is contained in:
Tom Hacohen
2020-12-29 17:18:09 +02:00
parent 332f7e2332
commit 709bc6c1fc
7 changed files with 70 additions and 39 deletions

View File

@@ -15,7 +15,7 @@ class UnicodeUsernameValidator(validators.RegexValidator):
class UserManager(DjangoUserManager):
def get_by_natural_key(self, username):
def get_by_natural_key(self, username: str):
return self.get(**{self.model.USERNAME_FIELD + "__iexact": username})
@@ -37,7 +37,7 @@ class User(AbstractUser):
)
@classmethod
def normalize_username(cls, username):
def normalize_username(cls, username: str):
return super().normalize_username(username).lower()