Commit a6c16026 authored by Clément Schreiner's avatar Clément Schreiner
Browse files

Make bool_field property return False if no value is found in the dict.

parent aec6c204
......@@ -96,7 +96,7 @@ def test_result(cls):
def bool_field(name):
""" Property exposing a string ('true' or 'false') as a bool. """
def fget(instance):
return True if instance[name] == 'true' else False
return True if instance.get(name, 'false') == 'true' else False
def fset(instance, value):
if not isinstance(value, bool):
......
Supports Markdown
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