mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 11:30:23 +00:00
Add check for invalid dotted attribute names in expressions
This provides better feedback for typos and mistakes.
This commit is contained in:
parent
68d469788d
commit
9e467c5e57
@ -424,6 +424,10 @@ class _ExpressionFormat(string.Formatter):
|
||||
key = '.' + left.attr + key
|
||||
left = left.value
|
||||
key = left.id + key
|
||||
if (not key.startswith('custom.') and
|
||||
_get_valid_attrname(key) not in allattributes.node):
|
||||
raise ValueError(
|
||||
'{0} is not a valid attribute name'.format(key))
|
||||
val = self._expand_attribute(key)
|
||||
return val['value'] if val and 'value' in val else ""
|
||||
elif isinstance(node, ast.Name):
|
||||
|
Loading…
Reference in New Issue
Block a user