# HG changeset patch # User souliane # Date 1400707071 -7200 # Node ID 85c110c0be86a5847a96fd826ad83fe9fdc13510 # Parent 066308706dc6a972fd88c7ae1997f530fa8e0e22 plugins misc_account, misc_register_account: manually delete the sessions when not needed anymore diff -r 066308706dc6 -r 85c110c0be86 src/memory/params.py --- a/src/memory/params.py Wed May 21 23:15:01 2014 +0200 +++ b/src/memory/params.py Wed May 21 23:17:51 2014 +0200 @@ -191,7 +191,7 @@ elif return_profile_keys and profile_key in ["@ALL@"]: return profile_key # this value must be managed by the caller if not self.storage.hasProfile(profile_key): - log.error(_('Trying to access an unknown profile')) + log.error(_('Trying to access an unknown profile (%s)') % profile_key) return "" # FIXME: raise exceptions.ProfileUnknownError here (must be well checked, this method is used in lot of places) return profile_key diff -r 066308706dc6 -r 85c110c0be86 src/plugins/plugin_misc_account.py --- a/src/plugins/plugin_misc_account.py Wed May 21 23:15:01 2014 +0200 +++ b/src/plugins/plugin_misc_account.py Wed May 21 23:17:51 2014 +0200 @@ -360,6 +360,7 @@ @profile (str): %(doc_profile)s """ password = self._sessions.profileGet(data['session_id'], profile)['new_password'] + del self._sessions[data['session_id']] def passwordChanged(result): d = self.host.memory.setParam(C.PROFILE_PASS_PATH[1], password, C.PROFILE_PASS_PATH[0], profile_key=profile) diff -r 066308706dc6 -r 85c110c0be86 src/plugins/plugin_misc_register_account.py --- a/src/plugins/plugin_misc_register_account.py Wed May 21 23:15:01 2014 +0200 +++ b/src/plugins/plugin_misc_register_account.py Wed May 21 23:17:51 2014 +0200 @@ -84,7 +84,9 @@ self.host.memory.setParam("Port", session_data["Port"], "Connection", profile_key=profile) user = jid.parse(session_data['JabberID'])[0] - return self._registerNewAccount(user, session_data["Password"], None, session_data["Server"], profile_key=profile) + d = self._registerNewAccount(user, session_data["Password"], None, session_data["Server"], profile_key=profile) + del self._sessions[data['session_id']] + return d def _registerNewAccount(self, user, password, email, host, port=5222, profile_key=C.PROF_KEY_NONE): """Connect to a server and create a new account using in-band registration.