changeset 1469:b46fec21ceb9

pages (lists/edit): redirect to item instead of list and don't show confirm message
author Goffi <goffi@goffi.org>
date Fri, 01 Oct 2021 12:13:07 +0200
parents e85ef5f3515e
children 837ae0c4b858
files libervia/pages/lists/edit/page_meta.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/pages/lists/edit/page_meta.py	Fri Oct 01 12:12:30 2021 +0200
+++ b/libervia/pages/lists/edit/page_meta.py	Fri Oct 01 12:13:07 2021 +0200
@@ -78,8 +78,7 @@
     template_data["new_list_item_xmlui"] = list_item
 
 
-@defer.inlineCallbacks
-def on_data_post(self, request):
+async def on_data_post(self, request):
     data = self.getRData(request)
     service = data["service"]
     node = data["node"]
@@ -94,20 +93,21 @@
     profile = self.getProfile(request)
 
     # we convert back body to XHTML
-    body = yield self.host.bridgeCall(
+    body = await self.host.bridgeCall(
         "syntaxConvert", posted_data['body'][0], "markdown", C.SYNTAX_XHTML,
         False, profile)
     posted_data['body'] = ['<div xmlns="{ns}">{body}</div>'.format(ns=C.NS_XHTML,
                                                                      body=body)]
 
     extra = {'update': True}
-    yield self.host.bridgeCall(
+    await self.host.bridgeCall(
         "listSet", service.full(), node, posted_data, "", item_id,
         data_format.serialise(extra), profile
     )
-    # we don't want to redirect to edit page on success, but to list overview
     data["post_redirect_page"] = (
-        self.getPageByName("lists"),
+        self.getPageByName("list_view"),
         service.full(),
         node or "@",
+        item_id
     )
+    return C.POST_NO_CONFIRM