Explicitly assign typeclass for newly created objectdb

This commit is contained in:
Tehom 2016-12-02 17:21:44 -05:00
parent 19e8bed5ab
commit 5e7211a053

View file

@ -147,6 +147,13 @@ class ObjectDBAdmin(admin.ModelAdmin):
obj.save()
if not change:
# adding a new object
# no idea why this has to be called manually, __init__ does not seem to be called
from evennia.utils.utils import class_from_module
try:
typeclass = class_from_module(obj.db_typeclass_path)
except ImportError:
typeclass = class_from_module("evennia.objects.objects.DefaultObject")
obj.__class__ = typeclass
obj.basetype_setup()
obj.basetype_posthook_setup()
obj.at_object_creation()