Commit 8acf9292 authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_oauth2_authorisation: Make logged_in_once usable as ERP5Form action

Base_callDialogMethod may not provide REQUEST nor RESPONSE, and may provide
other arguments. Make the former optional, ignore the latter, and fallback
on RequestContainer's magic when REQUEST is None.
parent 7cc05d8f
Pipeline #29811 passed with stage
in 0 seconds
...@@ -9,6 +9,11 @@ portal = context.getPortalObject() ...@@ -9,6 +9,11 @@ portal = context.getPortalObject()
if portal.portal_skins.updateSkinCookie(): if portal.portal_skins.updateSkinCookie():
portal.setupCurrentSkin() portal.setupCurrentSkin()
if REQUEST is None:
# BBB: support Base_callDialogMethod-style caller
REQUEST = context.REQUEST
# Note: RESPONSE agument is present for API consistency purposes, but unused.
# So do not bother setting it here.
environ = REQUEST.environ environ = REQUEST.environ
if ( if (
environ['REQUEST_METHOD'] != 'POST' or environ['REQUEST_METHOD'] != 'POST' or
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>REQUEST, RESPONSE</string> </value> <value> <string>REQUEST=None, RESPONSE=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment