def get_home(self, site=None): try: home = self.published(site).all_root().order_by("tree_id")[0] except IndexError: raise NoHomeFound('No Root page found. Publish at least one page!') return home
def get_home(self, site=None): try: home = self.published(site).distinct().get(is_home=True) except self.model.DoesNotExist: raise NoHomeFound('No Root page found. Publish at least one page!') return home