mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-16 11:13:15 +00:00
Prevent AppRegistryNotReady error when wagtail.contrib.sitemaps is in INSTALLED_APPS
Fixes #4729
This commit is contained in:
parent
8f0df1e192
commit
38e9eb26e6
1 changed files with 1 additions and 1 deletions
|
|
@ -2,7 +2,6 @@ import warnings
|
|||
|
||||
from django.contrib.sitemaps import Sitemap as DjangoSitemap
|
||||
|
||||
from wagtail.core.models import Site
|
||||
from wagtail.core.utils import accepts_kwarg
|
||||
from wagtail.utils.deprecation import RemovedInWagtail24Warning
|
||||
|
||||
|
|
@ -23,6 +22,7 @@ class Sitemap(DjangoSitemap):
|
|||
def get_wagtail_site(self):
|
||||
site = getattr(self.request, 'site', None)
|
||||
if site is None:
|
||||
from wagtail.core.models import Site
|
||||
return Site.objects.select_related(
|
||||
'root_page'
|
||||
).get(is_default_site=True)
|
||||
|
|
|
|||
Loading…
Reference in a new issue