Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
d24f9b12
Commit
d24f9b12
authored
Mar 24, 2018
by
Jerry Pussinen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change some flask-login User related methods to properties
parent
88b3370b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
app.py
examples/auth-flask-login/app.py
+5
-0
app.py
examples/auth-mongoengine/app.py
+5
-0
No files found.
examples/auth-flask-login/app.py
View file @
d24f9b12
...
...
@@ -32,12 +32,17 @@ class User(db.Model):
password
=
db
.
Column
(
db
.
String
(
64
))
# Flask-Login integration
# NOTE: is_authenticated, is_active, and is_anonymous
# are methods in Flask-Login < 0.3.0
@
property
def
is_authenticated
(
self
):
return
True
@
property
def
is_active
(
self
):
return
True
@
property
def
is_anonymous
(
self
):
return
False
...
...
examples/auth-mongoengine/app.py
View file @
d24f9b12
...
...
@@ -27,12 +27,17 @@ class User(db.Document):
password
=
db
.
StringField
(
max_length
=
64
)
# Flask-Login integration
# NOTE: is_authenticated, is_active, and is_anonymous
# are methods in Flask-Login < 0.3.0
@
property
def
is_authenticated
(
self
):
return
True
@
property
def
is_active
(
self
):
return
True
@
property
def
is_anonymous
(
self
):
return
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment