Explorar o código

修复将 status != -1 误写为 username != -1 的 bug

flying1020 %!s(int64=6) %!d(string=hai) anos
pai
achega
75a67ed382
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      walle/form/user.py

+ 1 - 1
walle/form/user.py

@@ -52,7 +52,7 @@ class RegistrationForm(UserForm):
 
     def validate_username(self, field):
         """ username muse be unique """
-        if UserModel.query.filter(UserModel.username == field.data, UserModel.username != -1).count():
+        if UserModel.query.filter(UserModel.username == field.data, UserModel.status != -1).count():
             raise ValidationError('此用户名已经被注册')