changeset 1292:e30e96958fb7

server: use C.SITE_NAME_DEFAULT instead of "sat" when suitable
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 16:47:51 +0200
parents 6daab90bfb8a
children de3b15d68bb6
files libervia/server/server.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/server/server.py	Fri Jun 19 16:47:51 2020 +0200
+++ b/libervia/server/server.py	Fri Jun 19 16:47:51 2020 +0200
@@ -776,7 +776,8 @@
     @template.contextfilter
     def _front_url_filter(self, ctx, relative_url):
         template_data = ctx['template_data']
-        return os.path.join('/', C.TPL_RESOURCE, template_data.site or 'sat',
+        return os.path.join(
+            '/', C.TPL_RESOURCE, template_data.site or C.SITE_NAME_DEFAULT,
             C.TEMPLATE_TPL_DIR, template_data.theme, relative_url)
 
     def _moveFirstLevelToDict(self, options, key, keys_to_keep):
@@ -899,8 +900,8 @@
         templates_res = web_resource.Resource()
         self.putChildAll(C.TPL_RESOURCE.encode('utf-8'), templates_res)
         for site_name, site_path in self.renderer.sites_paths.items():
-            templates_res.putChild(site_name.encode('utf-8') or b'sat',
-                                   ProtectedFile(site_path))
+            templates_res.putChild(site_name.encode() or C.SITE_NAME_DEFAULT.encode(),
+                                   static.File(site_path))
 
         d = self.bridgeCall("namespacesGet")
         d.addCallback(self._namespacesGetCb)