Skip to content

Commit

Permalink
Check for 'render' method on value when rendering model fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel2392 committed Apr 16, 2024
1 parent 6d5983c commit dd8b315
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wagtail_fedit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ def get_field_content(request, instance, meta_field: models.Field, context, cont
if hasattr(content, "render_as_block"):
content = content.render_as_block(context)

# The content might otherwise have a render method.
elif hasattr(content, "render"):
content = content.render(context)

return content

def is_draft_capable(model):
Expand Down

0 comments on commit dd8b315

Please sign in to comment.