Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2023-11-06 13:05:49 +0300
committerPhilipp Hörist <philipp@hoerist.com>2023-11-06 13:05:49 +0300
commite9b334752c2e6a864e3214d955c7e62bb3f91e11 (patch)
treefdc5ee5c5a1b9995dfe1cb7c54098bfbe8e9faad
parent82c2d725b2474d2e4e8a892df327376a390d7065 (diff)
new: Application: Make sure no account without username is created
-rw-r--r--gajim/common/application.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/gajim/common/application.py b/gajim/common/application.py
index fea3b9b68..b9a09d924 100644
--- a/gajim/common/application.py
+++ b/gajim/common/application.py
@@ -337,7 +337,7 @@ class CoreApplication(ged.EventHelper):
def create_account(self,
account: str,
- username: str,
+ username: str | None,
domain: str,
password: str,
proxy_name: str | None,
@@ -347,10 +347,13 @@ class CoreApplication(ged.EventHelper):
anonymous: bool = False
) -> None:
- account_label = f'{username}@{domain}'
if anonymous:
username = 'anon'
- account_label = f'anon@{domain}'
+
+ if not username:
+ raise ValueError('Username must be set')
+
+ account_label = f'{username}@{domain}'
config: dict[str, str | int | bool] = {
'name': username,