🐛 fix typo update -> upsert

This commit is contained in:
远野千束 2024-04-19 00:31:49 +08:00
parent 5c1170f6fb
commit 62a2755ecf

View File

@ -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 = user_db.first(User(), "user_id = ?", user_id, default=User(user_id=user_id))
user.profile["lang"] = lang_code 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 _user_lang[user_id] = lang_code