mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 22:17:17 +02:00
Fix sorting prototyes with non-string attr/tag data. Resolve #2364.
This commit is contained in:
parent
24d89f93d2
commit
7215bab388
1 changed files with 4 additions and 2 deletions
|
|
@ -325,7 +325,8 @@ def prototype_from_object(obj):
|
|||
if aliases:
|
||||
prot["aliases"] = aliases
|
||||
tags = sorted(
|
||||
[(tag.db_key, tag.db_category, tag.db_data) for tag in obj.tags.all(return_objs=True)]
|
||||
[(tag.db_key, tag.db_category, tag.db_data) for tag in obj.tags.all(return_objs=True)],
|
||||
key=lambda tup: (str(tup[0]), tup[1] or '', tup[2] or '')
|
||||
)
|
||||
if tags:
|
||||
prot["tags"] = tags
|
||||
|
|
@ -333,7 +334,8 @@ def prototype_from_object(obj):
|
|||
[
|
||||
(attr.key, attr.value, attr.category, ";".join(attr.locks.all()))
|
||||
for attr in obj.attributes.all()
|
||||
]
|
||||
],
|
||||
key=lambda tup: (str(tup[0]), tup[1] or '', tup[2] or '', tup[3])
|
||||
)
|
||||
if attrs:
|
||||
prot["attrs"] = attrs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue