Commit e809d0d9 authored by Nitish Rathi's avatar Nitish Rathi

Make compatible with python 3

parent a4c87dac
...@@ -1164,8 +1164,8 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -1164,8 +1164,8 @@ class BaseModelView(BaseView, ActionsMixin):
""" """
try: try:
self.on_model_change(form, model, is_created) self.on_model_change(form, model, is_created)
except TypeError, e: except TypeError as e:
if e.message == 'on_model_change() takes exactly 3 arguments (4 given)': if re.match(r'on_model_change\(\) takes .* 3 .* arguments .* 4 .* given .*', e.message):
msg = ('%s.on_model_change() now accepts third ' + msg = ('%s.on_model_change() now accepts third ' +
'parameter is_created. Please update your code') % self.model 'parameter is_created. Please update your code') % self.model
warnings.warn(msg) 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