From 064a4083c5f8fd93d803c94ee8bcb067526bc871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Thu, 23 Mar 2023 10:49:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20the=20`IntegrityError`=20c?= =?UTF-8?q?aused=20by=20not=20executing=20the=20update=20command=20when=20?= =?UTF-8?q?updating=20`player=5Finfo`=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/services/players/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/services/players/services.py b/core/services/players/services.py index aa1d447f..879a0e76 100644 --- a/core/services/players/services.py +++ b/core/services/players/services.py @@ -121,7 +121,7 @@ class PlayerInfoService(BaseService): player_info_enka = await self.get_player_info_from_enka(player.player_id) if player_info_enka is None: player_info.last_save_time = datetime.now() - await self._players_info_repository.update(PlayerInfoSQLModel.from_orm(player_info)) + await self._players_info_repository.update(player_info) await self.set_form_cache(player_info) return player_info player_info.nickname = player_info_enka.nickname @@ -130,7 +130,7 @@ class PlayerInfoService(BaseService): player_info.hand_image = player_info_enka.avatar.id player_info.nickname = player_info_enka.nickname player_info.last_save_time = datetime.now() - await self._players_info_repository.update(PlayerInfoSQLModel.from_orm(player_info)) + await self._players_info_repository.update(player_info) await self.set_form_cache(player_info) return player_info