ZODB Components: Migrate Products.ERP5Type.SessionTool from filesystem.
Showing
-
Owner
For reference, this can cause difficulties when products are updated and business template is not yet updated.
setAuthCookie
here is using session tool to set the user cookie. This fail when session tool is broken (when removed from filesystem but not yet installed by business template).There are several easy workarounds, login in from
/
instead of/erp5
or apply a patch like this:diff --git a/product/ERP5Type/patches/CookieCrumbler.py b/product/ERP5Type/patches/CookieCrumbler.py index d73385ccbf..91638d7af3 100644 --- a/product/ERP5Type/patches/CookieCrumbler.py +++ b/product/ERP5Type/patches/CookieCrumbler.py @@ -145,7 +145,13 @@ def modifyRequest(self, req, resp): path=self.getCookiePath()) method = self.getCookieMethod( 'setAuthCookie' , self.defaultSetAuthCookie ) + + # XXX make sure we can login when session tool is not yet migrated + from ZODB.broken import PersistentBroken + if isinstance(getattr(self.getPortalObject(), 'portal_sessions', None), PersistentBroken): + method = self.defaultSetAuthCookie method( resp, self.auth_cookie, quote( ac ) ) + elif req.has_key(self.auth_cookie): # Attempt to resume a session if the cookie is valid. # Copy __ac to the auth header.
-
Owner
Maybe it would be nice to have a way to run upgrader that does not require any user action.
Please register or sign in to comment