This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user