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
Exemple #2
0
 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