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
3362942f
Commit
3362942f
authored
Sep 19, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #313 from delciotorres/master
The mongoengine auth example won't work TypeError and AttributeError
parents
97ec7f7c
24a81327
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
auth.py
examples/auth-mongoengine/auth.py
+3
-3
No files found.
examples/auth-mongoengine/auth.py
View file @
3362942f
...
@@ -37,7 +37,7 @@ class User(db.Document):
...
@@ -37,7 +37,7 @@ class User(db.Document):
return
False
return
False
def
get_id
(
self
):
def
get_id
(
self
):
return
s
elf
.
id
return
s
tr
(
self
.
id
)
# Required for administrative interface
# Required for administrative interface
def
__unicode__
(
self
):
def
__unicode__
(
self
):
...
@@ -104,7 +104,7 @@ def index():
...
@@ -104,7 +104,7 @@ def index():
@
app
.
route
(
'/login/'
,
methods
=
(
'GET'
,
'POST'
))
@
app
.
route
(
'/login/'
,
methods
=
(
'GET'
,
'POST'
))
def
login_view
():
def
login_view
():
form
=
LoginForm
(
request
.
form
)
form
=
LoginForm
(
request
.
form
)
if
helpers
.
validate_form_on_submit
(
form
):
if
request
.
method
==
'POST'
and
form
.
validate
(
):
user
=
form
.
get_user
()
user
=
form
.
get_user
()
login
.
login_user
(
user
)
login
.
login_user
(
user
)
return
redirect
(
url_for
(
'index'
))
return
redirect
(
url_for
(
'index'
))
...
@@ -115,7 +115,7 @@ def login_view():
...
@@ -115,7 +115,7 @@ def login_view():
@
app
.
route
(
'/register/'
,
methods
=
(
'GET'
,
'POST'
))
@
app
.
route
(
'/register/'
,
methods
=
(
'GET'
,
'POST'
))
def
register_view
():
def
register_view
():
form
=
RegistrationForm
(
request
.
form
)
form
=
RegistrationForm
(
request
.
form
)
if
helpers
.
validate_form_on_submit
(
form
):
if
request
.
method
==
'POST'
and
form
.
validate
(
):
user
=
User
()
user
=
User
()
form
.
populate_obj
(
user
)
form
.
populate_obj
(
user
)
...
...
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