用户名不区分大小写;

修复更新problem时的一些问题
This commit is contained in:
zema1
2017-11-02 15:29:08 +08:00
parent b86ebf0ed7
commit 70f52b6f27
5 changed files with 103 additions and 78 deletions

View File

@@ -20,7 +20,7 @@ class UserManager(models.Manager):
use_in_migrations = True
def get_by_natural_key(self, username):
return self.get(**{self.model.USERNAME_FIELD: username})
return self.get(**{f"{self.model.USERNAME_FIELD}__iexact": username})
class User(AbstractBaseUser):