Commit 7f50b304 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Kazuhiko Shiozaki

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 83b1bed4
...@@ -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