[FIX] b_v_inheritance_extension: fix parsing of 'update' operation
This fixes an error we could get if the attribute of the inherited tag has some extra carriage returns. Exception raised: SyntaxError: unexpected EOF while parsingpull/2494/head
parent
45e79144af
commit
a227c1e942
|
@ -112,7 +112,8 @@ class IrUiView(models.Model):
|
|||
for spec in specs:
|
||||
attr_name = spec.get("name")
|
||||
# Parse ast from both node and spec
|
||||
source_ast = ast.parse(node.get(attr_name) or "{}", mode="eval").body
|
||||
node_attr = (node.get(attr_name) or "{}").strip()
|
||||
source_ast = ast.parse(node_attr, mode="eval").body
|
||||
update_ast = ast.parse(spec.text.strip(), mode="eval").body
|
||||
if not isinstance(source_ast, ast.Dict):
|
||||
raise TypeError(f"Attribute `{attr_name}` is not a dict")
|
||||
|
|
Loading…
Reference in New Issue