首页 > flask-admin中使用flask-login实现登录,但是登录时任意密码都可以登陆。

flask-admin中使用flask-login实现登录,但是登录时任意密码都可以登陆。

并且使用不存在的用户名登录时总是报错:
if not force and not user.is_active():
AttributeError: 'NoneType' object has no attribute 'is_active'

def is_active(self):
    return True

代码就是参考flask-admin的auth例子写的。

【热门文章】
【热门文章】