annotate libervia/pages/login/logged/page_meta.py @ 1139:e45480b6ba24

pages (blog): use DeferredList while discovering identities instead or waiting for each request individually.
author Goffi <goffi@goffi.org>
date Fri, 11 Jan 2019 16:39:46 +0100
parents 28e3eb3bb217
children 29eb15062416
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
963
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python2.7
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
3
1102
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
4 from libervia.server import session_iface
963
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
5 from sat.core.log import getLogger
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
6
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
7 log = getLogger("pages/login")
963
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
8
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
9 """SàT log-in page, with link to create an account"""
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
10
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
11 template = u"login/logged.html"
1102
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
12
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
13
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
14 def prepare_render(self, request):
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
15 template_data = request.template_data
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
16 session_data = self.host.getSessionData(request, session_iface.ISATSession)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
17 template_data["guest_session"] = session_data.guest
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
18 template_data["session_started"] = session_data.started