Skip to content

Commit

Permalink
fix: RelationalBone: dict size change during iteration (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
phorward authored Jan 6, 2025
1 parent 08a4f96 commit ff02a2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/viur/core/bones/relational.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,10 @@ def serialize_dest_rel(in_value: dict | None = None) -> (dict | None, dict | Non
super().serialize(skel, name, parentIndexed)

# Clean old properties from entry (prevent name collision)
for key in skel.dbEntity:
for key in tuple(skel.dbEntity.keys()):
if key.startswith(f"{name}."):
del skel.dbEntity[key]

indexed = self.indexed and parentIndexed

if not (new_vals := skel.accessedValues.get(name)):
Expand Down

0 comments on commit ff02a2f

Please sign in to comment.