Fix home button in 500 page

Currently, 500 page uses WEBROOT to set home link where WEBROOT is being taken
from horizon.conf module. However, this module sets only HORIZON_CONFIG.
As a result, 500 page is rendered with empty link, pointing home button
to current page.

This patch loads WEBROOT to horizon.conf, so it can be used in template
for 500 error page.

Change-Id: Icdd23703527a09a61d1326992b25a1004713444e
Closes-Bug: 1507563
This commit is contained in:
Aleš Křivák 2015-10-19 14:14:59 +02:00
parent aa068eca80
commit 0887c2b8df

View File

@ -14,6 +14,7 @@ import copy
from django.utils.functional import empty # noqa
from django.utils.functional import LazyObject # noqa
from django.utils.functional import SimpleLazyObject # noqa
class LazySettings(LazyObject):
@ -44,4 +45,11 @@ class LazySettings(LazyObject):
self._setup(name)
return self._wrapped.get(name, fallback)
def get_webroot():
from django.conf import settings
return settings.WEBROOT
HORIZON_CONFIG = LazySettings()
WEBROOT = SimpleLazyObject(get_webroot)