core, plugins: host.getClient now raise an exception instead of returning None when no profile is found, plugins have been adapted consequently and a bit cleaned

This commit is contained in:
Goffi 2014-03-28 18:07:02 +01:00
commit a6897c76e0

View file

@ -17,7 +17,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sat.core.i18n import _
from sat.core import exceptions
from constants import Const
from wokkel.xmppim import RosterItem
@ -116,7 +115,7 @@ class FakeSAT(object):
@return: client or None if it doesn't exist"""
profile = self.memory.getProfileName(profile_key)
if not profile:
return None
raise exceptions.ProfileKeyUnknownError
if profile not in self.profiles:
self.profiles[profile] = FakeClient(self, profile)
self.profiles[profile].client_initialized.callback(None)