From 22e983978fcbd84896468017dd5bdacf8a18cf3c Mon Sep 17 00:00:00 2001 From: Nathan Kinder Date: Wed, 11 Mar 2015 16:51:29 -0700 Subject: Don't explicitly save sessions Saving a session causes it to be unlocked, but sessions have a hook that also performs a save just before the session is finalized. In CherryPy 3.3.0 and later, an assertion was added to ensure that a session is locked when trying to perform a save. Since we perform explicit saves in our code, this causes the assertion to be tripped when the hook executes. This patch removes our explicit save calls. We should rely on the hook to save and unlock the session. https://fedorahosted.org/ipsilon/ticket/84 Signed-off-by: Nathan Kinder Reviewed-by: Simo Sorce --- ipsilon/util/user.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ipsilon/util/user.py b/ipsilon/util/user.py index fd557a0..1ce5c17 100644 --- a/ipsilon/util/user.py +++ b/ipsilon/util/user.py @@ -154,7 +154,6 @@ class UserSession(Log): def save_user_attrs(self, userattrs): cherrypy.session['userattrs'] = userattrs - cherrypy.session.save() self._debug('Saved user attrs') self.userattrs = userattrs @@ -171,7 +170,6 @@ class UserSession(Log): def save_provider_data(self, provider, data): attr = self._get_provider_attr_name(provider) cherrypy.session[attr] = data - cherrypy.session.save() self._debug('Saved %s provider data' % provider) def save_data(self, facility, name, data): @@ -179,7 +177,6 @@ class UserSession(Log): if facility not in cherrypy.session: cherrypy.session[facility] = dict() cherrypy.session[facility][name] = data - cherrypy.session.save() self._debug('Saved session data named [%s:%s]' % (facility, name)) def get_data(self, facility, name): @@ -202,4 +199,3 @@ class UserSession(Log): else: del cherrypy.session[facility] self._debug('Nuked session facility [%s]' % (facility,)) - cherrypy.session.save() -- cgit