changeset 1611:b695b98851fc

pages (events/new): use coroutines.
author Goffi <goffi@goffi.org>
date Wed, 12 Jun 2024 23:09:49 +0200
parents 19c83dd943df
children ebd538cb26cb
files libervia/web/pages/events/new/page_meta.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/web/pages/events/new/page_meta.py	Wed Jun 12 23:09:12 2024 +0200
+++ b/libervia/web/pages/events/new/page_meta.py	Wed Jun 12 23:09:49 2024 +0200
@@ -14,8 +14,7 @@
 log = getLogger(__name__)
 
 
-@defer.inlineCallbacks
-def on_data_post(self, request):
+async def on_data_post(self, request):
     request_data = self.get_r_data(request)
     profile = self.get_profile(request)
     title, location, body, date, main_img, bg_img = self.get_posted_data(
@@ -32,8 +31,8 @@
             self.page_error(request, C.HTTP_BAD_REQUEST)
         data[var] = value
     data["register"] = C.BOOL_TRUE
-    node = yield self.host.bridge_call("event_create", timestamp, data, "", "", "", profile)
+    node = await self.host.bridge_call("event_create", timestamp, data, "", "", "", profile)
     log.info("Event node created at {node}".format(node=node))
 
     request_data["post_redirect_page"] = (self.get_page_by_name("event_admin"), "@", node)
-    defer.returnValue(C.POST_NO_CONFIRM)
+    return C.POST_NO_CONFIRM