from grandchallenge.core.sitemaps import SubdomainSitemap
from grandchallenge.pages.models import Page


class PagesSitemap(SubdomainSitemap):
    priority = 0.8

    def items(self):
        return Page.objects.filter(
            permission_level=Page.ALL, challenge__hidden=False
        )

from grandchallenge.core.sitemaps import SubdomainSitemap
from grandchallenge.pages.models import Page


class PagesSitemap(SubdomainSitemap):
    priority = 0.8

    def items(self):
        return Page.objects.filter(
            permission_level=Page.ALL, challenge__hidden=False, hidden=False,
        )

Remove hidden public pages from sitemap
Remove hidden public pages from sitemap

  from grandchallenge.core.sitemaps import SubdomainSitemap
  from grandchallenge.pages.models import Page
  
  
  class PagesSitemap(SubdomainSitemap):
      priority = 0.8
  
      def items(self):
          return Page.objects.filter(
-             permission_level=Page.ALL, challenge__hidden=False
+             permission_level=Page.ALL, challenge__hidden=False, hidden=False,
          )
  
Remove hidden public pages from sitemap
## Code Before:
from grandchallenge.core.sitemaps import SubdomainSitemap
from grandchallenge.pages.models import Page


class PagesSitemap(SubdomainSitemap):
    priority = 0.8

    def items(self):
        return Page.objects.filter(
            permission_level=Page.ALL, challenge__hidden=False
        )

## Instruction:
Remove hidden public pages from sitemap
## Code After:
from grandchallenge.core.sitemaps import SubdomainSitemap
from grandchallenge.pages.models import Page


class PagesSitemap(SubdomainSitemap):
    priority = 0.8

    def items(self):
        return Page.objects.filter(
            permission_level=Page.ALL, challenge__hidden=False, hidden=False,
        )
