Fix bug, List content block not working.

This commit is contained in:
Lorenz Padberg 2024-03-21 11:06:24 +01:00
parent 9ca85fbcfe
commit f7727140ea
1 changed files with 4 additions and 3 deletions

View File

@ -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