I dislike the formatting of this conditional. Can you please change it so that you fetch the `MENU_HIDE_EMPTY` into a local variable prior to the conditional?

    hide_empty = getattr(settings, 'MENU_HIDE_EMPTY', False)
    if hide_empty and not self.check and not len(visible_children):