mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Make search_account also search by account alias. Resolve #1910
This commit is contained in:
parent
a35dcedcc0
commit
ad2e0ce0be
1 changed files with 9 additions and 2 deletions
|
|
@ -169,9 +169,16 @@ class AccountDBManager(TypedObjectManager, UserManager):
|
|||
typeclass = "%s" % typeclass
|
||||
query["db_typeclass_path"] = typeclass
|
||||
if exact:
|
||||
return self.filter(**query)
|
||||
matches = self.filter(**query)
|
||||
else:
|
||||
return self.filter(**query)
|
||||
matches = self.filter(**query)
|
||||
if not matches:
|
||||
# try alias match
|
||||
matches = self.filter(
|
||||
db_tags__db_tagtype__iexact="alias",
|
||||
**{"db_tags__db_key__iexact" if exact else "db_tags__db_key__icontains": ostring})
|
||||
return matches
|
||||
|
||||
# back-compatibility alias
|
||||
account_search = search_account
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue