mirror of
https://github.com/evennia/evennia.git
synced 2026-04-18 14:19:05 +02:00
Added an extra check to make sure the 'candidates' keyword to ev.search_object always contain proper dbobjs and not typeclasses. Resolves Issue 280.
This commit is contained in:
parent
99c2dda8dc
commit
31daf5b013
2 changed files with 8 additions and 0 deletions
|
|
@ -273,6 +273,10 @@ class ObjectManager(TypedObjectManager):
|
||||||
if dbref_match:
|
if dbref_match:
|
||||||
return [dbref_match]
|
return [dbref_match]
|
||||||
|
|
||||||
|
# Convenience check to make sure candidates are really dbobjs
|
||||||
|
if candidates:
|
||||||
|
candidates = [cand.dbobj for cand in make_iter(candidates) if hasattr(cand, "dbobj")]
|
||||||
|
|
||||||
# Search through all possibilities.
|
# Search through all possibilities.
|
||||||
|
|
||||||
match_number = None
|
match_number = None
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,10 @@ class ScriptManager(TypedObjectManager):
|
||||||
ok = False
|
ok = False
|
||||||
if ok:
|
if ok:
|
||||||
return [dbref_match]
|
return [dbref_match]
|
||||||
|
if obj:
|
||||||
|
# convenience check to make sure obj is really a dbobj
|
||||||
|
obj = hasattr(obj, "dbobj") and obj.dbobj or obj
|
||||||
|
|
||||||
# not a dbref; normal search
|
# not a dbref; normal search
|
||||||
scripts = self.filter(db_key__iexact=ostring)
|
scripts = self.filter(db_key__iexact=ostring)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue