Skip to content

Commit 20f02f4

Browse files
committed
[validation.py] Adapt Object Has Attribute Check
1 parent b3409c0 commit 20f02f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

odml/validation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ def object_required_attributes(obj):
133133
for arg in args:
134134
if arg[1] == 1:
135135
if not hasattr(obj, arg[0]):
136-
msg = "%s has no attribute %s" % (obj.format().name.capitalize(), arg[0])
137-
yield AttributeError(obj, msg, LABEL_WARNING)
136+
msg = "Missing attribute %s for %s" % (obj.format().name.capitalize(), arg[0])
137+
yield ValidationError(obj, msg, LABEL_WARNING)
138+
return
138139
obj_arg = getattr(obj, arg[0])
139140
if not obj_arg and not isinstance(obj_arg, bool):
140141
msg = "%s %s undefined" % (obj.format().name.capitalize(), arg[0])

0 commit comments

Comments
 (0)