Merge pull request #1529 from pypeclub/bugfix/validate_is_file_attribute

Validate is file attribute in settings schema
This commit is contained in:
Milan Kolar 2021-05-19 19:04:35 +02:00 committed by GitHub
commit bea68d194f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 10 deletions

View file

@ -846,6 +846,13 @@ class ItemEntity(BaseItemEntity):
)
raise EntitySchemaError(self, reason)
if self.is_file and self.file_item is not None:
reason = (
"Entity has set `is_file` to true but"
" it's parent is already marked as file item."
)
raise EntitySchemaError(self, reason)
super(ItemEntity, self).schema_validations()
def create_schema_object(self, *args, **kwargs):

View file

@ -10,7 +10,6 @@
"collapsible": true,
"key": "publish",
"label": "Publish plugins",
"is_file": true,
"children": [
{
"type": "dict",

View file

@ -603,7 +603,6 @@
"collapsible": true,
"key": "publish",
"label": "Publish plugins",
"is_file": true,
"children": [
{
"type": "dict",

View file

@ -11,7 +11,6 @@
"key": "create",
"label": "Creator plugins",
"collapsible_key": true,
"is_file": true,
"object_type": {
"type": "dict",
"children": [
@ -56,7 +55,6 @@
"collapsible": true,
"key": "publish",
"label": "Publish plugins",
"is_file": true,
"children": [
{
"type": "dict",

View file

@ -4,7 +4,6 @@
"label": "Site Sync (beta testing)",
"collapsible": true,
"checkbox_key": "enabled",
"is_file": true,
"children": [
{
"type": "boolean",
@ -44,7 +43,6 @@
"key": "sites",
"label": "Sites",
"collapsible_key": false,
"is_file": true,
"object_type":
{
"type": "dict",

View file

@ -10,7 +10,6 @@
"collapsible": true,
"key": "publish",
"label": "Publish plugins",
"is_file": true,
"children": [
{
"type": "schema_template",

View file

@ -97,7 +97,6 @@
"key": "sites",
"label": "Sites",
"collapsible_key": false,
"is_file": true,
"object_type":
{
"type": "dict",
@ -156,8 +155,7 @@
},
"is_group": true,
"key": "templates_mapping",
"label": "Templates mapping",
"is_file": true
"label": "Templates mapping"
}
]
},