Commit e2042595 authored by Christophe Benz's avatar Christophe Benz

check condition before fields selection

parent 4ee379f3
......@@ -108,7 +108,7 @@ class IFormatter(object):
raise FieldNotFound(selected_field)
fields_iterator = obj.iter_fields() if hasattr(obj, 'iter_fields') else iter_fields(obj)
d = OrderedDict([(k, v) for k, v in iter_select_and_decorate(fields_iterator)])
d = dict(fields_iterator)
if condition is not None and not condition.is_valid(d):
d = None
return d
return None
return OrderedDict([(k, v) for k, v in iter_select_and_decorate(d.iteritems())])
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