# HG changeset patch # User Goffi # Date 1680873636 -7200 # Node ID ae5158f3c420aea7995527c89d3c3fa8d3cb34f4 # Parent ce879da7fcf7e3d25aa9dcdf1eab3b429827f856 pages (events): quick fix following changes in backend events diff -r ce879da7fcf7 -r ae5158f3c420 libervia/pages/events/page_meta.py --- 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"]