Commit 009e7a41 authored by Paul Brown's avatar Paul Brown

fix backwards compat issue with form rules + flask.ext.admin

parent 2e626e33
......@@ -400,12 +400,13 @@ class RuleSet(object):
result = []
for r in rules:
if isinstance(r, BaseRule):
result.append(r.configure(self, parent))
elif isinstance(r, string_types):
if isinstance(r, string_types):
result.append(self.convert_string(r).configure(self, parent))
else:
raise ValueError('Dont know how to convert %s' % repr(r))
try:
result.append(r.configure(self, parent))
except AttributeError:
raise TypeError('Could not convert "%s" to rule' % repr(r))
return result
......
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