Mercurial > libervia-web
diff src/server/pages.py @ 994:b92b06f023cb
pages: profile is now always set in template_data, and None if there is no user logged
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 13 Dec 2017 00:37:12 +0100 |
parents | 6daa59d44ee2 |
children | f88325b56a6a |
line wrap: on
line diff
--- a/src/server/pages.py Wed Dec 13 00:35:56 2017 +0100 +++ b/src/server/pages.py Wed Dec 13 00:37:12 2017 +0100 @@ -767,11 +767,13 @@ def renderPage(self, request, skip_parse_url=False): """Main method to handle the workflow of a LiberviaPage""" + # template_data are the variables passed to template if not hasattr(request, 'template_data'): session_data = self.host.getSessionData(request, session_iface.ISATSession) csrf_token = session_data.csrf_token - request.template_data = {u'csrf_token': csrf_token} + request.template_data = {u'profile': session_data.profile, + u'csrf_token': csrf_token} # XXX: here is the code which need to be executed once # at the beginning of the request hanling