misc: serve a minimalistic template if no portal have been deployed (#48737)

This commit is contained in:
Frédéric Péters 2020-11-20 18:20:26 +01:00
parent 59d13b7300
commit eec5780a80
1 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,10 @@ class RemoteTemplate(object):
from hobo.multitenant.settings_loaders import TemplateVars
from hobo.deploy.utils import get_hobo_json
context = TemplateVars.get_hobo_json_variables(get_hobo_json())
if 'portal_url' not in context:
# serve a minimalistic template if no portal have been
# deployed.
return Template('<html><body>{% block content %}{% endblock %}</body></html>')
self.theme_skeleton_url = context['portal_url'] + '__skeleton__/'
else:
self.theme_skeleton_url = settings.THEME_SKELETON_URL