mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 修复清理重复记录逻辑,确保检查记录的id属性有效性
This commit is contained in:
parent
428f553c34
commit
8cb8555c97
@ -294,7 +294,7 @@ class Model(TortoiseModel):
|
||||
return None
|
||||
|
||||
# 如果需要清理重复记录
|
||||
if clean_duplicates and hasattr(cls, "id"):
|
||||
if clean_duplicates and hasattr(records[0], "id"):
|
||||
# 按 id 排序
|
||||
records = sorted(
|
||||
records, key=lambda x: getattr(x, "id", 0), reverse=True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user