Skip to content

Commit db48d3a

Browse files
committed
Nested fields cannot use list action
1 parent 486cab7 commit db48d3a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

onyx/data/management/commands/project.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,12 @@ def set_groups(self, project: Project, group_configs: Dict[str, List[GroupConfig
541541
for field in permission_config.fields:
542542
assert field, "Field cannot be empty."
543543

544+
# Nested fields cannot have the LIST action
545+
if action == Actions.LIST.label and "__" in field:
546+
raise ValueError(
547+
f"Nested fields cannot be used with '{Actions.LIST.label}' action: {field}"
548+
)
549+
544550
# Create/update permission to access the object's field
545551
access_object_field = (
546552
Actions.ACCESS.label,

0 commit comments

Comments
 (0)