diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/pixelated/resources/login_resource.py | 4 | ||||
-rw-r--r-- | service/pixelated/resources/root_resource.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/service/pixelated/resources/login_resource.py b/service/pixelated/resources/login_resource.py index ab91176a..1e7c26a5 100644 --- a/service/pixelated/resources/login_resource.py +++ b/service/pixelated/resources/login_resource.py @@ -102,6 +102,8 @@ class LoginResource(BaseResource): self._portal = portal self._disclaimer_banner = disclaimer_banner self.putChild('startup-assets', File(self._startup_folder)) + with open(os.path.join(self._startup_folder, 'Interstitial.html')) as f: + self.interstitial = f.read() def set_portal(self, portal): self._portal = portal @@ -129,7 +131,7 @@ class LoginResource(BaseResource): def render_response(leap_session): request.setResponseCode(OK) - request.write(open(os.path.join(self._startup_folder, 'Interstitial.html')).read()) + request.write(self.interstitial) request.finish() self._setup_user_services(leap_session, request) diff --git a/service/pixelated/resources/root_resource.py b/service/pixelated/resources/root_resource.py index f27138b0..8353ed7e 100644 --- a/service/pixelated/resources/root_resource.py +++ b/service/pixelated/resources/root_resource.py @@ -49,6 +49,8 @@ class RootResource(BaseResource): self._html_template = open(os.path.join(self._static_folder, 'index.html')).read() self._services_factory = services_factory self._child_resources = ChildResourcesMap() + with open(os.path.join(self._startup_assets_folder, 'Interstitial.html')) as f: + self.interstitial = f.read() self._startup_mode() def _startup_mode(self): @@ -123,7 +125,7 @@ class RootResource(BaseResource): def render_GET(self, request): self._add_csrf_cookie(request) if self._is_starting(): - return open(os.path.join(self._startup_assets_folder, 'Interstitial.html')).read() + return self.interstitial else: account_email = self.mail_service(request).account_email response = Template(self._html_template).safe_substitute(account_email=account_email) |