Skip to content
Snippets Groups Projects
Commit 9c784448 authored by Swen Vermeul's avatar Swen Vermeul
Browse files

read allowed attributes from definitions.py

parent 472de03e
No related branches found
No related tags found
No related merge requests found
...@@ -415,13 +415,17 @@ class AttrHolder(): ...@@ -415,13 +415,17 @@ class AttrHolder():
name = name_map[name] name = name_map[name]
if self._is_new: if self._is_new:
#if name not in self._allowed_attrs_new:
if name not in self._defs['attrs_new']: if name not in self._defs['attrs_new']:
raise ValueError("No such attribute: «{}» for entity: {}".format(name, self.entity)) raise ValueError(
"No such attribute: «{}» for entity: {}. Allowed attributes are: {}"
.format(name, self.entity, self._defs['attrs_new'])
)
else: else:
#if name not in self._allowed_attrs_up:
if name not in self._defs['attrs_up']: if name not in self._defs['attrs_up']:
raise ValueError("No such attribute: «{}» for entity: {}".format(name, self.entity)) raise ValueError(
"No such attribute: «{}» for entity: {}. Allowed attributes are: {}"
.format(name, self.entity, self._defs['attrs_up'])
)
if name in ["parents", "children", "components"]: if name in ["parents", "children", "components"]:
......
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