mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 09:46:32 +01:00
Fixed a bug when reporting multi-match errors in the default at_search_result with a particular input. Resolves #963.
This commit is contained in:
parent
cce87a8399
commit
6e606ae530
1 changed files with 5 additions and 3 deletions
|
|
@ -1549,12 +1549,14 @@ def at_search_result(matches, caller, query="", quiet=False, **kwargs):
|
|||
error = kwargs.get("nofound_string") or _("Could not find '%s'." % query)
|
||||
matches = None
|
||||
elif len(matches) > 1:
|
||||
error = kwargs.get("multimatch_string",
|
||||
_("More than one match for '%s' (please narrow target):" % query))
|
||||
error = kwargs.get("multimatch_string") or \
|
||||
_("More than one match for '%s' (please narrow target):" % query)
|
||||
for num, result in enumerate(matches):
|
||||
error += "\n %i%s%s%s" % (
|
||||
aliases = result.aliases.all()
|
||||
error += "\n %i%s%s%s%s" % (
|
||||
num + 1, _MULTIMATCH_SEPARATOR,
|
||||
result.get_display_name(caller) if hasattr(result, "get_display_name") else query,
|
||||
" [%s]" % ";".join(aliases) if aliases else "",
|
||||
result.get_extra_info(caller))
|
||||
matches = None
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue