mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
immutable dict is validating keys with allowed symbols
This commit is contained in:
parent
7f39cf5dd4
commit
01d0660253
1 changed files with 8 additions and 2 deletions
|
|
@ -7,7 +7,8 @@ from .lib import (
|
|||
)
|
||||
from pype.settings.constants import (
|
||||
METADATA_KEYS,
|
||||
M_OVERRIDEN_KEY
|
||||
M_OVERRIDEN_KEY,
|
||||
KEY_REGEX
|
||||
)
|
||||
from . import (
|
||||
BaseItemEntity,
|
||||
|
|
@ -17,7 +18,8 @@ from . import (
|
|||
)
|
||||
from .exceptions import (
|
||||
SchemaDuplicatedKeys,
|
||||
EntitySchemaError
|
||||
EntitySchemaError,
|
||||
InvalidKeySymbols
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -88,6 +90,10 @@ class DictImmutableKeysEntity(ItemEntity):
|
|||
else:
|
||||
raise SchemaDuplicatedKeys(self, child_entity.key)
|
||||
|
||||
for key in self.keys():
|
||||
if not KEY_REGEX.match(key):
|
||||
raise InvalidKeySymbols(self.path, key)
|
||||
|
||||
if self.checkbox_key:
|
||||
checkbox_child = self.non_gui_children.get(self.checkbox_key)
|
||||
if not checkbox_child:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue