Commit d24f9b12 authored by Jerry Pussinen's avatar Jerry Pussinen

Change some flask-login User related methods to properties

parent 88b3370b
...@@ -32,12 +32,17 @@ class User(db.Model): ...@@ -32,12 +32,17 @@ class User(db.Model):
password = db.Column(db.String(64)) password = db.Column(db.String(64))
# Flask-Login integration # Flask-Login integration
# NOTE: is_authenticated, is_active, and is_anonymous
# are methods in Flask-Login < 0.3.0
@property
def is_authenticated(self): def is_authenticated(self):
return True return True
@property
def is_active(self): def is_active(self):
return True return True
@property
def is_anonymous(self): def is_anonymous(self):
return False return False
......
...@@ -27,12 +27,17 @@ class User(db.Document): ...@@ -27,12 +27,17 @@ class User(db.Document):
password = db.StringField(max_length=64) password = db.StringField(max_length=64)
# Flask-Login integration # Flask-Login integration
# NOTE: is_authenticated, is_active, and is_anonymous
# are methods in Flask-Login < 0.3.0
@property
def is_authenticated(self): def is_authenticated(self):
return True return True
@property
def is_active(self): def is_active(self):
return True return True
@property
def is_anonymous(self): def is_anonymous(self):
return False return False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment