From e35bacecd55b37e58bf64498f459ad8e77ef32fc Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 26 Apr 2024 10:42:24 +0800 Subject: [PATCH] fix #1942 --- app/db/subscribehistory_oper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/db/subscribehistory_oper.py b/app/db/subscribehistory_oper.py index 6119904a..701396d2 100644 --- a/app/db/subscribehistory_oper.py +++ b/app/db/subscribehistory_oper.py @@ -17,6 +17,9 @@ class SubscribeHistoryOper(DbOper): kwargs = {k: v for k, v in kwargs.items() if hasattr(SubscribeHistory, k)} # 更新完成订阅时间 kwargs.update({"date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())}) + # 去掉主键 + if "id" in kwargs: + kwargs.pop("id") subscribe = SubscribeHistory(**kwargs) subscribe.create(self._db)