comparison src/pages/g/page_meta.py @ 938:9be057e23ce6

pages (g): use new constants
author Goffi <goffi@goffi.org>
date Thu, 27 Apr 2017 01:15:24 +0200
parents b5490fa65348
children aba7208d9d50
comparison
equal deleted inserted replaced
937:00236973e138 938:9be057e23ce6
46 if current_id is None: 46 if current_id is None:
47 log.debug(_(u"checking invitation [{id}]").format(id=invitation_id)) 47 log.debug(_(u"checking invitation [{id}]").format(id=invitation_id))
48 try: 48 try:
49 data = yield self.host.bridge.invitationGet(invitation_id) 49 data = yield self.host.bridge.invitationGet(invitation_id)
50 except Exception: 50 except Exception:
51 self.pageError(request, 401) 51 self.pageError(request, C.HTTP_UNAUTHORIZED)
52 else: 52 else:
53 guest_session.id = invitation_id 53 guest_session.id = invitation_id
54 guest_session.data = data 54 guest_session.data = data
55 else: 55 else:
56 data = guest_session.data 56 data = guest_session.data
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=503) 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 74 sat_session.profile = profile
75 75