Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion wagtail_react_streamfield/monkey_patch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from functools import wraps

from django.conf import settings

from wagtail.core.blocks import (
BlockField, Block, BaseStreamBlock, ListBlock, BaseStructBlock, FieldBlock,
StaticBlock)
Expand Down Expand Up @@ -67,7 +69,7 @@ def patch():
'FIELD_NAME_TEMPLATE', 'get_default', 'get_children_errors',
'prepare_value', 'get_instance_html', 'definition',
'html_declarations', 'all_html_declarations')
Block._meta_class.closed = False
Block._meta_class.closed = getattr(settings, "BLOCK_CLOSED_BY_DEFAULT", False)
_patch_with(BaseStreamBlock, NewBaseStreamBlock,
'definition', 'sorted_child_blocks', 'render_list_member',
'html_declarations', 'js_initializer', 'prepare_value',
Expand Down