sigil-on
All checks were successful
Deploy on push / deploy (push) Successful in 6s

This commit is contained in:
2025-05-30 14:08:29 +03:00
parent f160ab4d26
commit 90260534eb
6 changed files with 36 additions and 27 deletions

View File

@@ -290,26 +290,26 @@ def get_with_stat(q):
stat["followers"] = cols[2] # Статистика по подписчикам
if is_author:
# Дополнительная проверка типа entity.id
if not hasattr(entity, 'id'):
if not hasattr(entity, "id"):
logger.error(f"Entity does not have id attribute: {entity}")
continue
entity_id = entity.id
if not isinstance(entity_id, int):
logger.error(f"Entity id is not integer: {entity_id} (type: {type(entity_id)})")
continue
stat["authors"] = get_author_authors_stat(entity_id) # Статистика по подпискам на авторов
stat["comments"] = get_author_comments_stat(entity_id) # Статистика по комментариям
else:
# Дополнительная проверка типа entity.id для тем
if not hasattr(entity, 'id'):
if not hasattr(entity, "id"):
logger.error(f"Entity does not have id attribute: {entity}")
continue
entity_id = entity.id
if not isinstance(entity_id, int):
logger.error(f"Entity id is not integer: {entity_id} (type: {type(entity_id)})")
continue
stat["authors"] = get_topic_authors_stat(entity_id) # Статистика по авторам темы
entity.stat = stat
records.append(entity)