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:
parent
ed9df2984d
commit
a6897c76e0
1 changed files with 25 additions and 140 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue