Unverified Commit 683e99f9 authored by Petrus Janse van Rensburg's avatar Petrus Janse van Rensburg Committed by GitHub

Merge pull request #1720 from dinhnv/fix_py3_exception_message

Fix #1715 python3 exception has no attribute 'message'
parents 9264a987 9886741f
......@@ -1555,7 +1555,7 @@ class BaseModelView(BaseView, ActionsMixin):
try:
self.on_model_change(form, model, is_created)
except TypeError as e:
if re.match(r'on_model_change\(\) takes .* 3 .* arguments .* 4 .* given .*', e.message):
if re.match(r'on_model_change\(\) takes .* 3 .* arguments .* 4 .* given .*', str(e)):
msg = ('%s.on_model_change() now accepts third ' +
'parameter is_created. Please update your code') % self.model
warnings.warn(msg)
......
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