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:
Griatch 2012-10-14 13:25:25 +02:00
parent 99c2dda8dc
commit 31daf5b013
2 changed files with 8 additions and 0 deletions

View file

@ -202,6 +202,10 @@ class ScriptManager(TypedObjectManager):
ok = False
if ok:
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
scripts = self.filter(db_key__iexact=ostring)