From 560def1f2bea5a8c69b7238be52797644c11e609 Mon Sep 17 00:00:00 2001 From: Tehom Date: Mon, 5 Dec 2016 06:58:05 -0500 Subject: [PATCH] Better solution - can call __init__ manually with typeclass as a kwarg, and this seems to resolve it --- evennia/objects/admin.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/evennia/objects/admin.py b/evennia/objects/admin.py index 890841ac7a..3e0d75f6cb 100644 --- a/evennia/objects/admin.py +++ b/evennia/objects/admin.py @@ -147,13 +147,8 @@ 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 + # have to call init with typeclass passed to it + obj.__init__(typeclass=obj.db_typeclass_path) obj.basetype_setup() obj.basetype_posthook_setup() obj.at_object_creation()