From f7727140ea89a32d468ed949d5c22e9a69f3f56d Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Thu, 21 Mar 2024 11:06:24 +0100 Subject: [PATCH] Fix bug, List content block not working. --- server/books/schema/mutations/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/books/schema/mutations/utils.py b/server/books/schema/mutations/utils.py index b6fc0f1b..26d0df40 100644 --- a/server/books/schema/mutations/utils.py +++ b/server/books/schema/mutations/utils.py @@ -144,15 +144,16 @@ def handle_content_block(content, context=None, module=None, allowed_blocks=ALLO } } elif content['type'] == 'content_list_item': - if content.get('id') is not None: # the list block existed already + if content.get('id') is not None: # the list block existed already previous_item = get_previous_item(previous_contents=previous_contents, item=content) previous_content = previous_item.get('value') else: previous_content = None value = [handle_content_block(c, context, module, previous_contents=previous_content) for c in content['contents']] - content['value'] = value - return content + return {'type': 'content_list_item', + 'value': value, + 'id': content.get('id')} elif content['type'] == 'readonly' and previous_contents is not None: # get first item that matches the id # users can re-order readonly items, but we won't let them change them otherwise, so we just take the