Remove fallback on BASE_URL

pull/9956/head
Matt Westcott 2023-01-30 17:32:13 +00:00 zatwierdzone przez Matt Westcott
rodzic 1e4417ae0c
commit 1a0344216c
2 zmienionych plików z 2 dodań i 20 usunięć

Wyświetl plik

@ -24,10 +24,6 @@ This is the base URL used by the Wagtail admin site. It is typically used for ge
If this setting is not present, Wagtail will try to fall back to `request.site.root_url` or to the request's host name.
```{versionchanged} 3.0
This setting was previously named ``BASE_URL`` and was undocumented, using ``BASE_URL`` will be removed in a future release.
```
(append_slash)=
## Append Slash

Wyświetl plik

@ -1,26 +1,12 @@
from warnings import warn
from django.conf import settings
from django.utils.http import url_has_allowed_host_and_scheme
from wagtail.utils.deprecation import RemovedInWagtail50Warning
def get_admin_base_url():
"""
Gets the base URL for the wagtail admin site. This is set in `settings.WAGTAILADMIN_BASE_URL`,
which was previously `settings.BASE_URL`.
Gets the base URL for the wagtail admin site. This is set in `settings.WAGTAILADMIN_BASE_URL`.
"""
admin_base_url = getattr(settings, "WAGTAILADMIN_BASE_URL", None)
if admin_base_url is None and hasattr(settings, "BASE_URL"):
warn(
"settings.BASE_URL has been renamed to settings.WAGTAILADMIN_BASE_URL",
category=RemovedInWagtail50Warning,
)
admin_base_url = settings.BASE_URL
return admin_base_url
return getattr(settings, "WAGTAILADMIN_BASE_URL", None)
def get_valid_next_url_from_request(request):