From e37b014d4aae124e1822348f3140c5cf93df8722 Mon Sep 17 00:00:00 2001 From: Johnny Date: Wed, 24 Oct 2018 00:52:57 +0000 Subject: [PATCH] Fixes web UI dropdown failure to refresh after character creation. --- evennia/accounts/accounts.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/evennia/accounts/accounts.py b/evennia/accounts/accounts.py index f4711299cf..6a599f8d91 100644 --- a/evennia/accounts/accounts.py +++ b/evennia/accounts/accounts.py @@ -190,9 +190,18 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)): def sessions(self): return AccountSessionHandler(self) - @lazy_property + # Do not make this a lazy property; the web UI will not refresh it! + @property def characters(self): - return self.db._playable_characters + # Get playable characters list + objs = self.db._playable_characters + + # Rebuild the list if legacy code left null values after deletion + if None in objs: + objs = [x for x in self.db._playable_characters if x] + self.db._playable_characters = objs + + return objs # session-related methods