kopia lustrzana https://github.com/wagtail/wagtail
When generating dummy requests for pages with no routable URL, fall back on a hostname from ALLOWED_HOSTS and finally localhost
rodzic
c7b997bd02
commit
f3f7b466b1
|
@ -581,7 +581,12 @@ class Page(MP_Node, ClusterableModel, Indexed):
|
|||
path = url_info.path
|
||||
port = url_info.port or 80
|
||||
else:
|
||||
hostname = 'example.com'
|
||||
# Cannot determine a URL to this page - cobble one together based on
|
||||
# whatever we find in ALLOWED_HOSTS
|
||||
try:
|
||||
hostname = settings.ALLOWED_HOSTS[0]
|
||||
except IndexError:
|
||||
hostname = 'localhost'
|
||||
path = '/'
|
||||
port = 80
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue