From b6e094c9c044ff6b784cfc7d3452ebdb4aeae455 Mon Sep 17 00:00:00 2001 From: stefanfeng Date: Tue, 7 Apr 2026 14:14:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=20recordId/title=20?= =?UTF-8?q?=E4=B8=BA=20null=20=E7=9A=84=E5=BC=82=E5=B8=B8=E5=B9=BF?= =?UTF-8?q?=E5=9C=BA=E6=9D=A1=E7=9B=AE=EF=BC=88type!=3D1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/services/news_service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app/services/news_service.py b/backend/app/services/news_service.py index 6dca097..af68041 100755 --- a/backend/app/services/news_service.py +++ b/backend/app/services/news_service.py @@ -410,7 +410,10 @@ class NewsPlatformService: return p def _filter(items): - """过滤本人发布 + 无效 ID""" + """过滤本人发布 + 无效ID + 无标题/无recordId的空条目""" + # 过滤空条目(recordId/title 为 null,type!=1 等异常数据) + items = [x for x in items + if x.get("recordId") and x.get("title") and x.get("type") == "1"] if platform_uid: items = [x for x in items if x.get("createUser") != platform_uid] items = [x for x in items