From e2c83c13ba0ca1edf94b5af0408f17c0d1aa4e95 Mon Sep 17 00:00:00 2001 From: sw00 Date: Mon, 9 Nov 2015 22:39:14 -0200 Subject: use mail_service to inject account_email into root_resource instead of using leap_session, mail_service can be used to get the account email. --- service/pixelated/resources/root_resource.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'service/pixelated/resources') diff --git a/service/pixelated/resources/root_resource.py b/service/pixelated/resources/root_resource.py index fd3c4f92..7bb7b3ad 100644 --- a/service/pixelated/resources/root_resource.py +++ b/service/pixelated/resources/root_resource.py @@ -35,8 +35,8 @@ class RootResource(Resource): return self return Resource.getChild(self, path, request) - def initialize(self, leap_session, keymanager, search_engine, mail_service, draft_service, feedback_service): - self._leap_session = leap_session + def initialize(self, keymanager, search_engine, mail_service, draft_service, feedback_service): + self.account_email = mail_service.account_email self.putChild('assets', File(self._static_folder)) self.putChild('keys', KeysResource(keymanager)) @@ -71,6 +71,5 @@ class RootResource(Resource): if self._is_starting(): return open(os.path.join(self._startup_assets_folder, 'Interstitial.html')).read() else: - email = self._leap_session.account_email() - response = Template(self._html_template).safe_substitute(account_email=email) + response = Template(self._html_template).safe_substitute(account_email=self.account_email) return str(response) -- cgit v1.2.3