From aadf9ed7e48e39ea4a0f1605bb6b7079dcb5754e Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 29 Jan 2020 11:00:14 +0100 Subject: [PATCH] core (xmpp): raise InternalError when a new profile Client is created while there is already one in host --- sat/core/xmpp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sat/core/xmpp.py b/sat/core/xmpp.py index 6b991b8c..ef0ef8a4 100644 --- a/sat/core/xmpp.py +++ b/sat/core/xmpp.py @@ -168,6 +168,9 @@ class SatXMPPEntity(object): password = yield host.memory.asyncGetParamA( "Password", "Connection", profile_key=profile ) + if profile in host.profiles: + raise exceptions.InternalError( + f"There is already a profile of name {profile} in host") entity = host.profiles[profile] = cls( host, profile, jid.JID(host.memory.getParamA("JabberID", "Connection", profile_key=profile)), password,