From c49180f59d1852e09f16b560a4f47ee6d3c0b17e Mon Sep 17 00:00:00 2001 From: InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:45:10 -0700 Subject: [PATCH] use expected types for user/pass --- evennia/accounts/accounts.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/evennia/accounts/accounts.py b/evennia/accounts/accounts.py index 3fca3d39a..43870ce1f 100644 --- a/evennia/accounts/accounts.py +++ b/evennia/accounts/accounts.py @@ -778,6 +778,9 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): In this case we're simply piggybacking on this feature to apply additional normalization per Evennia's standards. """ + if not isinstance(username, str): + username = str(username) + username = super(DefaultAccount, cls).normalize_username(username) # strip excessive spaces in accountname @@ -1010,8 +1013,8 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): account = None errors = [] - username = kwargs.get("username") - password = kwargs.get("password") + username = kwargs.get("username", "") + password = kwargs.get("password", "") email = kwargs.get("email", "").strip() guest = kwargs.get("guest", False)