From 50af0e6e8046f980642d701cad828c3501d9d10c Mon Sep 17 00:00:00 2001 From: Jan Max Meyer Date: Sun, 19 Jan 2025 22:01:00 +0100 Subject: [PATCH] fix: Render bones which are `readOnly=True` not as `required=True` (#1371) --- src/viur/core/bones/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/viur/core/bones/base.py b/src/viur/core/bones/base.py index 5f45df3ea..08d729845 100644 --- a/src/viur/core/bones/base.py +++ b/src/viur/core/bones/base.py @@ -1447,14 +1447,14 @@ def structure(self) -> dict: ret = { "descr": self.descr, "type": self.type, - "required": self.required, + "required": self.required and not self.readOnly, "params": self.params, "visible": self.visible, "readonly": self.readOnly, "unique": self.unique.method.value if self.unique else False, "languages": self.languages, "emptyvalue": self.getEmptyValue(), - "indexed": self.indexed + "indexed": self.indexed, } # Provide a defaultvalue, if it's not a function. @@ -1470,6 +1470,8 @@ def structure(self) -> dict: } else: ret["multiple"] = self.multiple + + # Provide compute information if self.compute: ret["compute"] = { "method": self.compute.interval.method.name