Skip to content

Commit 44682f9

Browse files
fsbraunvinitkumar
andcommitted
fix: Wrong placholders rendered when using apphooks with own placeholders (#8343)
Co-authored-by: Vinit Kumar <vinit@django-cms.org>
1 parent cb8bdce commit 44682f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cms/plugin_rendering.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,19 +387,19 @@ def render_obj_placeholder(
387387
nodelist=None,
388388
editable: bool = True,
389389
):
390+
# Get current object from toolbar
391+
current_obj = self.toolbar.get_object()
390392
# Check if page, if so delegate to render_page_placeholder
391-
if self.current_page:
393+
if self.current_page and (isinstance(current_obj, (PageContent, type(None)))):
392394
return self.render_page_placeholder(
393395
slot,
394396
context,
395397
inherit,
396398
nodelist=nodelist,
397399
editable=editable,
398400
)
399-
400401
# Not page, therefore we will use toolbar object as
401402
# the current object and render the placeholder
402-
current_obj = self.toolbar.get_object()
403403
if current_obj is None:
404404
raise PlaceholderNotFound(f"No object found for placeholder '{slot}'")
405405
placeholder = rescan_placeholders_for_obj(current_obj).get(slot)

0 commit comments

Comments
 (0)