Improved db updates #130

This commit is contained in:
Sven Heidemann 2023-02-18 11:44:13 +01:00
parent de8262dae1
commit afff27b273
3 changed files with 6 additions and 6 deletions

View File

@ -252,10 +252,10 @@ class AuthUser(TableABC):
`EMail` = '{self._email}', `EMail` = '{self._email}',
`Password` = '{self._password}', `Password` = '{self._password}',
`PasswordSalt` = '{self._password_salt}', `PasswordSalt` = '{self._password_salt}',
`RefreshToken` = '{"NULL" if self._refresh_token is None else self._refresh_token}', `RefreshToken` = '{'null' if self._refresh_token is None else f'{self._refresh_token}'}',
`ConfirmationId` = '{"NULL" if self._confirmation_id is None else self._confirmation_id}', `ConfirmationId` = '{'null' if self._confirmation_id is None else f'{self._confirmation_id}'}',
`ForgotPasswordId` = '{"NULL" if self._forgot_password_id is None else self._forgot_password_id}', `ForgotPasswordId` = '{'null' if self._forgot_password_id is None else f'{self._forgot_password_id}'}',
`OAuthId` = '{"NULL" if self._oauth_id is None else self._oauth_id}', `OAuthId` = '{'null' if self._oauth_id is None else f'{self._oauth_id}'}',
`RefreshTokenExpiryTime` = '{self._refresh_token_expire_time.isoformat()}', `RefreshTokenExpiryTime` = '{self._refresh_token_expire_time.isoformat()}',
`AuthRole` = {self._auth_role_id.value}, `AuthRole` = {self._auth_role_id.value},
`LastModifiedAt` = '{self._modified_at}' `LastModifiedAt` = '{self._modified_at}'

View File

@ -154,7 +154,7 @@ class User(TableABC):
f""" f"""
UPDATE `Users` UPDATE `Users`
SET `XP` = {self._xp}, SET `XP` = {self._xp},
`MinecraftId` = '{self._minecraft_id}', `MinecraftId` = {'null' if self.minecraft_id is None else f'{self._minecraft_id}'},
`LastModifiedAt` = '{self._modified_at}' `LastModifiedAt` = '{self._modified_at}'
WHERE `UserId` = {self._user_id}; WHERE `UserId` = {self._user_id};
""" """

View File

@ -45,7 +45,7 @@ class UserMutation(QueryABC):
self._users.update_user(user) self._users.update_user(user)
self._db.save_changes() self._db.save_changes()
self._level_service.set_level(user) self._bot.loop.create_task(self._level_service.set_level(user))
user = self._users.get_user_by_id(input["id"]) user = self._users.get_user_by_id(input["id"])
return user return user