Fix bug, List content block not working.
This commit is contained in:
parent
9ca85fbcfe
commit
f7727140ea
|
|
@ -144,15 +144,16 @@ def handle_content_block(content, context=None, module=None, allowed_blocks=ALLO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elif content['type'] == 'content_list_item':
|
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_item = get_previous_item(previous_contents=previous_contents, item=content)
|
||||||
previous_content = previous_item.get('value')
|
previous_content = previous_item.get('value')
|
||||||
else:
|
else:
|
||||||
previous_content = None
|
previous_content = None
|
||||||
value = [handle_content_block(c, context, module, previous_contents=previous_content) for c in
|
value = [handle_content_block(c, context, module, previous_contents=previous_content) for c in
|
||||||
content['contents']]
|
content['contents']]
|
||||||
content['value'] = value
|
return {'type': 'content_list_item',
|
||||||
return content
|
'value': value,
|
||||||
|
'id': content.get('id')}
|
||||||
elif content['type'] == 'readonly' and previous_contents is not None:
|
elif content['type'] == 'readonly' and previous_contents is not None:
|
||||||
# get first item that matches the id
|
# 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
|
# users can re-order readonly items, but we won't let them change them otherwise, so we just take the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue