From 62a2755ecf645095f1a5621f414eab9b71c8b808 Mon Sep 17 00:00:00 2001 From: snowy Date: Fri, 19 Apr 2024 00:31:49 +0800 Subject: [PATCH] :bug: fix typo `update` -> `upsert` --- liteyuki/utils/base/language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liteyuki/utils/base/language.py b/liteyuki/utils/base/language.py index 5d58ada4..3d933f2d 100644 --- a/liteyuki/utils/base/language.py +++ b/liteyuki/utils/base/language.py @@ -149,7 +149,7 @@ def change_user_lang(user_id: str, lang_code: str): """ user = user_db.first(User(), "user_id = ?", user_id, default=User(user_id=user_id)) user.profile["lang"] = lang_code - user_db.update(user, "user_id = ?", user_id) + user_db.upsert(user, "user_id = ?", user_id) _user_lang[user_id] = lang_code