Skip to content
Merged
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
5 changes: 4 additions & 1 deletion wagtail_modeltranslation/patch_wagtailadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ def _patch_panels(self, panels_list, related_model=None):
if isinstance(panel, PanelPlaceholder):
# Create an instance of the panel according to the specs of the placeholder
real_panel = panel.construct()
initiated_panels_list.append(real_panel)
# `real_panel` will be none for the `CommentPanelPlaceholder` subclass if
# `WAGTAILADMIN_COMMENTS_ENABLED = False` is set in the settings
if real_panel is not None:
initiated_panels_list.append(real_panel)
elif isinstance(panel, str):
field = current_patching_model._meta.get_field(panel)
if isinstance(field, ManyToOneRel):
Expand Down