changeset 1374:25104d31479f

pages: `on_data_post` can now return `"continue"` string: if "continue" is returned, the page workflow is not interrupted with Post/Redirect/Get pattern.
author Goffi <goffi@goffi.org>
date Fri, 11 Dec 2020 17:35:03 +0100
parents 2938d1b65bd5
children e943b0c8eec5
files libervia/server/pages.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/server/pages.py	Sun Nov 29 17:08:36 2020 +0100
+++ b/libervia/server/pages.py	Fri Dec 11 17:35:03 2020 +0100
@@ -1045,7 +1045,7 @@
                                   'registered'))
                     return
             if profile != C.SERVICE_PROFILE:
-                #  only service profile is cache for now
+                #  only service profile is cached for now
                 return
             session_data = self.host.getSessionData(request, session_iface.ISATSession)
             locale = session_data.locale
@@ -1500,7 +1500,8 @@
             request.finish()
             raise failure.Failure(exceptions.CancelError("Post/Redirect/Get is used"))
         else:
-            self._on_data_post_redirect(ret, request)
+            if ret != "continue":
+                self._on_data_post_redirect(ret, request)
 
     def getPostedData(self, request, keys, multiple=False, raise_on_missing=True):
         """Get data from a POST request or from URL's query part and decode it