Skip to content
Snippets Groups Projects
Commit f121bd44 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

bugfix - if required is a bool, and it is false, validate attempted to call it as a function

parent ac2db87f
No related branches found
No related tags found
No related merge requests found
...@@ -473,8 +473,9 @@ class PropertyBase(object): ...@@ -473,8 +473,9 @@ class PropertyBase(object):
if (self.required is not None) and (value is None): if (self.required is not None) and (value is None):
# required may either be a boolean value # required may either be a boolean value
if isinstance(self.required, bool) and self.required: if isinstance(self.required, bool):
raise ValueError('A value is required') if self.required:
raise ValueError('A value is required')
# or a function # or a function
elif self.required(instance): elif self.required(instance):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment