diff libervia/pages/events/page_meta.py @ 1507:ae5158f3c420

pages (events): quick fix following changes in backend events
author Goffi <goffi@goffi.org>
date Fri, 07 Apr 2023 15:20:36 +0200
parents e3e303a30a74
children 106bae41f5c8
line wrap: on
line diff
--- a/libervia/pages/events/page_meta.py	Thu Mar 23 17:50:54 2023 +0100
+++ b/libervia/pages/events/page_meta.py	Fri Apr 07 15:20:36 2023 +0200
@@ -1,10 +1,12 @@
 #!/usr/bin/env python3
 
 
-from libervia.server.constants import Const as C
-from twisted.internet import defer
 from sat.core.i18n import _
 from sat.core.log import getLogger
+from sat.tools.common import data_format
+from twisted.internet import defer
+
+from libervia.server.constants import Const as C
 
 log = getLogger(__name__)
 
@@ -14,14 +16,16 @@
 template = "event/overview.html"
 
 
-@defer.inlineCallbacks
-def prepare_render(self, request):
+async def prepare_render(self, request):
     profile = self.getProfile(request)
     template_data = request.template_data
     template_data["url_event_new"] = self.getSubPageURL(request, "event_new")
     if profile is not None:
         try:
-            events = yield self.host.bridgeCall("eventsList", "", "", profile)
+            events = data_format.deserialise(
+                await self.host.bridgeCall("eventsGet", "", "", [], "", profile),
+                type_check=list
+            )
         except Exception as e:
             log.warning(_("Can't get events list for {profile}: {reason}").format(
                 profile=profile, reason=e))
@@ -34,18 +38,12 @@
                     event["url"] = self.getSubPageURL(
                         request,
                         "event_admin",
-                        event.get("service", ""),
-                        event.get("node", ""),
-                        event.get("item"),
                     )
                 else:
                     other_events.append(event)
                     event["url"] = self.getSubPageURL(
                         request,
                         "event_rsvp",
-                        event.get("service", ""),
-                        event.get("node", ""),
-                        event.get("item"),
                     )
                 if "thumb_url" not in event and "image" in event:
                     event["thumb_url"] = event["image"]