Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
f121bd44
Commit
f121bd44
authored
11 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tkprop/properties.py
+3
-2
3 additions, 2 deletions
tkprop/properties.py
with
3 additions
and
2 deletions
tkprop/properties.py
+
3
−
2
View file @
f121bd44
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment