comparison src/pages/g/page_meta.py @ 1100:5976dcd42591

pages (g): use server's connect method to connect instead of bridge, this way normal Libervia workflow is used, and session attributes are initialised.
author Goffi <goffi@goffi.org>
date Fri, 01 Jun 2018 18:31:29 +0200
parents 01e95ec9df9e
children cdd389ef97bc
comparison
equal deleted inserted replaced
1099:ea0d41ef3719 1100:5976dcd42591
59 log.debug(_(u"connecting profile [{}]").format(profile)) 59 log.debug(_(u"connecting profile [{}]").format(profile))
60 # we need to connect the profile 60 # we need to connect the profile
61 profile = data['guest_profile'] 61 profile = data['guest_profile']
62 password = data['password'] 62 password = data['password']
63 try: 63 try:
64 yield self.host.bridgeCall("connect", profile, password, {}) 64 yield self.host.connect(request, profile, password)
65 except Exception as e: 65 except Exception as e:
66 log.warning(_(u"Can't connect profile: {msg}").format( 66 log.warning(_(u"Can't connect profile: {msg}").format(
67 msg=e)) 67 msg=e))
68 # FIXME: no good error code correspond 68 # FIXME: no good error code correspond
69 # maybe use a custom one? 69 # maybe use a custom one?
70 self.pageError(request, code=C.HTTP_SERVICE_UNAVAILABLE) 70 self.pageError(request, code=C.HTTP_SERVICE_UNAVAILABLE)
71 71
72 log.info(_(u"guest session started, connected with profile [{profile}]".format( 72 log.info(_(u"guest session started, connected with profile [{profile}]".format(
73 profile = profile))) 73 profile = profile)))
74 sat_session.profile = profile
75 74
76 # we copy data useful in templates 75 # we copy data useful in templates
77 template_data = request.template_data 76 template_data = request.template_data
78 template_data['norobots'] = True 77 template_data['norobots'] = True
79 if u'name' in data: 78 if u'name' in data: