Fixed a bug in obj.copy() that tried to access contents without properly initializing the typeclass. Resolves Issue 288.
This commit is contained in:
parent
4dff822764
commit
0141f94e9d
1 changed files with 3 additions and 3 deletions
|
|
@ -856,11 +856,11 @@ class ObjectDB(TypedObject):
|
||||||
"""
|
"""
|
||||||
key = _GA(self, "key")
|
key = _GA(self, "key")
|
||||||
num = 1
|
num = 1
|
||||||
for obj in (obj for obj in _GA(_GA(self, "location"), "contents")
|
for obj in (obj for obj in self.location.contents
|
||||||
if obj.key.startswith(key) and obj.key.lstrip(key).isdigit()):
|
if obj.key.startswith(key) and obj.key.lstrip(key).isdigit()):
|
||||||
num += 1
|
num += 1
|
||||||
return "%s%02i" % (key, num)
|
return "%s%03i" % (key, num)
|
||||||
new_key = new_key or find_clone_key(self)
|
new_key = new_key or find_clone_key()
|
||||||
return ObjectDB.objects.copy_object(self, new_key=new_key)
|
return ObjectDB.objects.copy_object(self, new_key=new_key)
|
||||||
|
|
||||||
delete_iter = 0
|
delete_iter = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue