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
8e3b3ac3
Commit
8e3b3ac3
authored
Mar 16, 2015
by
Jacob Magnusson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix “object has no attribute 'message’” in py3
parent
1c63ca96
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
view.py
flask_admin/contrib/sqla/view.py
+2
-2
No files found.
flask_admin/contrib/sqla/view.py
View file @
8e3b3ac3
...
...
@@ -8,7 +8,7 @@ from sqlalchemy.exc import IntegrityError
from
flask
import
flash
from
flask.ext.admin._compat
import
string_types
from
flask.ext.admin._compat
import
string_types
,
text_type
from
flask.ext.admin.babel
import
gettext
,
ngettext
,
lazy_gettext
from
flask.ext.admin.model
import
BaseModelView
from
flask.ext.admin.model.form
import
wrap_fields_in_fieldlist
...
...
@@ -870,7 +870,7 @@ class ModelView(BaseModelView):
# Error handler
def
handle_view_exception
(
self
,
exc
):
if
isinstance
(
exc
,
IntegrityError
):
flash
(
gettext
(
'Integrity error.
%(message)
s'
,
message
=
exc
.
message
),
'error'
)
flash
(
gettext
(
'Integrity error.
%(message)
s'
,
message
=
text_type
(
exc
)
),
'error'
)
return
True
return
super
(
ModelView
,
self
)
.
handle_view_exception
(
exc
)
...
...
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