kopia lustrzana https://github.com/wagtail/wagtail
StaticBlock renders empty in templates (#12425)
rodzic
ee635534af
commit
207e9e50d9
|
@ -128,6 +128,7 @@ Changelog
|
|||
* Add "soft" client-side validation for `StreamBlock` / `ListBlock` `min_num` / `max_num` (Matt Westcott)
|
||||
* Log accessibility checker results in the console to help developers with troubleshooting (Thibaud Colas)
|
||||
* Disable pointer events on checker highlights to simplify DevTools inspections (Thibaud Colas)
|
||||
* `StaticBlock` now renders nothing by default when no template is specified (Sævar Öfjörð Magnússon)
|
||||
* Fix: Make `WAGTAILIMAGES_CHOOSER_PAGE_SIZE` setting functional again (Rohit Sharma)
|
||||
* Fix: Enable `richtext` template tag to convert lazy translation values (Benjamin Bach)
|
||||
* Fix: Ensure permission labels on group permissions page are translated where available (Matt Westcott)
|
||||
|
|
|
@ -71,6 +71,7 @@ This feature was developed by Bart Cieliński, alexkiro, and Sage Abdullah.
|
|||
* Prompt the user about unsaved changes when editing snippets (Sage Abdullah)
|
||||
* Add support for specifying different preview modes to the "View draft" URL for pages (Robin Varghese)
|
||||
* Implement new designs for the footer actions dropdown with more contrast and larger text (Sage Abdullah)
|
||||
* `StaticBlock` now renders nothing by default when no template is specified (Sævar Öfjörð Magnússon)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@ class StaticBlock(Block):
|
|||
def normalize(self, value):
|
||||
return None
|
||||
|
||||
def render_basic(self, value, context=None):
|
||||
return ""
|
||||
|
||||
class Meta:
|
||||
admin_text = None
|
||||
default = None
|
||||
|
|
|
@ -5015,6 +5015,11 @@ class TestStaticBlock(unittest.TestCase):
|
|||
result = block.render(None)
|
||||
self.assertEqual(result, "<p>PostsStaticBlock template</p>")
|
||||
|
||||
def test_render_without_template(self):
|
||||
block = blocks.StaticBlock()
|
||||
result = block.render(None)
|
||||
self.assertEqual(result, "")
|
||||
|
||||
def test_serialize(self):
|
||||
block = blocks.StaticBlock()
|
||||
result = block.get_prep_value(None)
|
||||
|
|
Ładowanie…
Reference in New Issue