changeset 943:aacda981c348

pages (g/e): use blog_uri from event instead of guest's main uri
author Goffi <goffi@goffi.org>
date Fri, 19 May 2017 13:54:49 +0200
parents 6b55d038b121
children 5d9f6d25c586
files src/pages/g/e/page_meta.py
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/pages/g/e/page_meta.py	Fri May 19 12:57:53 2017 +0200
+++ b/src/pages/g/e/page_meta.py	Fri May 19 13:54:49 2017 +0200
@@ -19,10 +19,9 @@
     template_data = request.template_data
     guest_session = self.host.getSessionData(request, session_iface.ISATGuestSession)
     try:
-        main_uri = guest_session.data['main_uri']
         event_uri = guest_session.data['event_uri']
     except KeyError:
-        log.warning(_(u"main or event URI not found, can't render event page"))
+        log.warning(_(u"event URI not found, can't render event page"))
         self.pageError(request, C.HTTP_SERVICE_UNAVAILABLE)
 
     data = self.getRData(request)
@@ -54,12 +53,8 @@
 
     ## Blog ##
 
-    main_uri_data = uri.parseXMPPUri(main_uri)
-    if main_uri_data[u'type'] != u'pubsub' or main_uri_data.get('sub_type') != 'microblog':
-        self.pageError(request, C.HTTP_SERVICE_UNAVAILABLE)
-
-    data[u'service'] = jid.JID(main_uri_data[u'path'])
-    data[u'node'] = main_uri_data[u'node']
+    data[u'service'] = jid.JID(event_data[u'blog_service'])
+    data[u'node'] = event_data[u'blog_node']
 
     # we now need blog items, using blog common page
     # this will fill the "items" template data