diff --git a/wagtail/wagtailadmin/edit_bird.py b/wagtail/wagtailadmin/edit_bird.py index 1bdff2f1f1..cb1decc494 100644 --- a/wagtail/wagtailadmin/edit_bird.py +++ b/wagtail/wagtailadmin/edit_bird.py @@ -28,6 +28,10 @@ class EditPageItem(BaseItem): def render_edit_bird(request, items): + # Don't render if the user is not logged in + if not request.user.is_authenticated(): + return + # Render the items rendered_items = [item.render(request) for item in items] diff --git a/wagtail/wagtailadmin/templatetags/wagtail_edit_bird.py b/wagtail/wagtailadmin/templatetags/wagtail_edit_bird.py index 13fe4a6326..1112517bff 100644 --- a/wagtail/wagtailadmin/templatetags/wagtail_edit_bird.py +++ b/wagtail/wagtailadmin/templatetags/wagtail_edit_bird.py @@ -29,4 +29,4 @@ def wagtail_edit_bird(context, current_page=None, items=None): fn(request, items) # Render edit bird - return edit_bird.render_edit_bird(request, items) + return edit_bird.render_edit_bird(request, items) or ''