diff options
author | sw00 <sett.wai@gmail.com> | 2015-11-09 22:39:14 -0200 |
---|---|---|
committer | sw00 <sett.wai@gmail.com> | 2015-11-09 22:39:14 -0200 |
commit | e2c83c13ba0ca1edf94b5af0408f17c0d1aa4e95 (patch) | |
tree | b546645e212e9bc0ef1e7ff118fc9f371dc36335 /service/pixelated/resources | |
parent | b230d58eaa32a7f115881cffbf5637d98d1e8299 (diff) |
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.
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/root_resource.py | 7 |
1 files changed, 3 insertions, 4 deletions
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) |