lesslogs
All checks were successful
Deploy on push / deploy (push) Successful in 2m55s

This commit is contained in:
2025-09-28 17:26:23 +03:00
parent 752e2dcbdc
commit af0f3e3dea
3 changed files with 17 additions and 154 deletions

View File

@@ -342,14 +342,14 @@ def get_shouts_with_links(
if has_field(info, "main_topic") or force_topics:
main_topic = None
if hasattr(row, "main_topic"):
logger.debug(f"Raw main_topic for shout#{shout_id}: {row.main_topic}")
# logger.debug(f"Raw main_topic for shout#{shout_id}: {row.main_topic}")
main_topic = (
orjson.loads(row.main_topic) if isinstance(row.main_topic, str) else row.main_topic
)
logger.debug(f"Parsed main_topic for shout#{shout_id}: {main_topic}")
# logger.debug(f"Parsed main_topic for shout#{shout_id}: {main_topic}")
if not main_topic and topics and len(topics) > 0:
logger.info(f"No main_topic found for shout#{shout_id}, using first topic from list")
# logger.info(f"No main_topic found for shout#{shout_id}, using first topic from list")
main_topic = {
"id": topics[0]["id"],
"title": topics[0]["title"],
@@ -365,7 +365,7 @@ def get_shouts_with_links(
"is_main": True,
}
shout_dict["main_topic"] = main_topic
logger.debug(f"Final main_topic for shout#{shout_id}: {main_topic}")
# logger.debug(f"Final main_topic for shout#{shout_id}: {main_topic}")
if has_field(info, "authors") and hasattr(row, "authors"):
authors_data = orjson.loads(row.authors) if isinstance(row.authors, str) else row.authors