summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoald de Vries <rdevries@thoughtworks.com>2016-12-01 17:35:33 +0100
committerRoald de Vries <rdevries@thoughtworks.com>2016-12-01 17:35:33 +0100
commit165ab49e41faa7ba7d524c58b3b0d383a4c9a2d9 (patch)
treede3c4b3cb2ec9ecd043fc3dc4879e21b8ec57938 /service
parentf0880aff32bbb30c6a8a0d4e078e563d24b97909 (diff)
use the right inbox template
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/resources/inbox_resource.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/service/pixelated/resources/inbox_resource.py b/service/pixelated/resources/inbox_resource.py
index f759dca9..426de5cc 100644
--- a/service/pixelated/resources/inbox_resource.py
+++ b/service/pixelated/resources/inbox_resource.py
@@ -34,15 +34,19 @@ class InboxResource(BaseResource):
def __init__(self, services_factory):
BaseResource.__init__(self, services_factory)
+ self._not_quite_the_templates_folder = self._get_not_quite_the_templates_folder()
self._templates_folder = self._get_templates_folder()
- self._html_template = open(os.path.join(self._templates_folder, 'index.html')).read()
+ self._html_template = open(os.path.join(self._not_quite_the_templates_folder, 'index.html')).read()
with open(os.path.join(self._templates_folder, 'Interstitial.html')) as f:
self.interstitial = f.read()
self._mode = MODE_STARTUP
def initialize(self):
self._mode = MODE_RUNNING
- logger.debug('Inbox in RUNNING mode. %s' % self)
+
+ def _get_not_quite_the_templates_folder(self):
+ path = os.path.dirname(os.path.abspath(pixelated.__file__))
+ return os.path.join(path, '..', '..', 'web-ui', 'app')
def _get_templates_folder(self):
path = os.path.dirname(os.path.abspath(pixelated.__file__))
@@ -52,12 +56,9 @@ class InboxResource(BaseResource):
return self._mode == MODE_STARTUP
def render_GET(self, request):
- logger.debug('Inbox rendering GET. %s' % self)
if self._is_starting():
- logger.debug('Inbox rendering interstitial. %s' % self)
return self.interstitial
else:
- logger.debug('Inbox rendering from template. %s' % self)
account_email = self.mail_service(request).account_email
response = Template(self._html_template).safe_substitute(account_email=account_email)
return str(response)