better validation

This commit is contained in:
Cal 2025-12-08 22:06:32 -07:00
parent 57b6d35b02
commit 261ca40aa0

View file

@ -1512,9 +1512,9 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
num = 1
if self.location:
num = max(0, *[
int(obj.key.lstrip(key) or 0)
int(obj.key.lstrip(key))
for obj in self.location.contents
if obj.key.startswith(key)
if obj.key.startswith(key) and obj.key.lstrip(key).isdigit()
])+1
return "%s%03i" % (key, num)