Skip to content

Commit

Permalink
resource: fix container resource children can't be in a list
Browse files Browse the repository at this point in the history
When I put the children in a list under the key "children" it completely broke traversal.

It means /Users/ worked but not /Users/<cn>/, it does now.

Fixes #44
  • Loading branch information
robvdl committed Mar 14, 2024
1 parent aa29ca7 commit 1267ca4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sambal/resources/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def __init__(self, request, container):
polymorphic=True,
)

self["children"] = []
for obj in queryset:
if obj:
resource_class = self.resource_for_model(obj)
self["children"].append(resource_class(request, obj))
self[obj.name] = resource_class(request, obj)

0 comments on commit 1267ca4

Please sign in to comment.