From 7baccb10b3f3df9535107c9397518e1dcb497af7 Mon Sep 17 00:00:00 2001 From: Arne Gudermann Date: Tue, 26 Nov 2024 15:30:51 +0100 Subject: [PATCH] Allow list in SpatialBone setBoneValue --- src/viur/core/bones/spatial.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/viur/core/bones/spatial.py b/src/viur/core/bones/spatial.py index c26fc8895..4f73b71fa 100644 --- a/src/viur/core/bones/spatial.py +++ b/src/viur/core/bones/spatial.py @@ -387,8 +387,9 @@ def setBoneValue( """ if append: raise ValueError(f"append is not possible on {self.type} bones") - assert isinstance(value, tuple) and len(value) == 2, "Value must be a tuple of (lat, lng)" - skel[boneName] = value + if not isinstance(value, (tuple, list)) and len(value) == 2: + raise ValueError("Value must be a tuple or a list of (lat, lng)") + skel[boneName] = tuple(value) def structure(self) -> dict: return super().structure() | {