Skip to content

Commit

Permalink
fix: 未解決の参照
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Aug 29, 2022
1 parent 567c86a commit 58eeb64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mipac/actions/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def get_me(self) -> UserDetailed:
"""

res = await self.__session.request(Route('POST', '/api/i'), auth=True)
return self.__client._modeler.create_user_instance(RawUser(res))
return UserDetailed(res, client=self.__client) # TODO: 自分用のクラスに変更する

@cached(ttl=10, namespace='get_user', key_builder=key_builder)
async def get(
Expand Down Expand Up @@ -74,7 +74,7 @@ async def get(
data = await self.__session.request(
Route('POST', '/api/users/show'), json=field, auth=True, lower=True
)
return self.__client._modeler.create_user_instance(RawUser(data))
return UserDetailed(data, client=self.__client)

@get_cache_key
async def fetch(
Expand Down Expand Up @@ -112,7 +112,7 @@ async def fetch(
)
old_cache = Cache(namespace='get_user')
await old_cache.delete(kwargs['cache_key'].format('get_user'))
return self.__client._modeler.create_user_instance(RawUser(data))
return UserDetailed(data, client=self.__client)

async def get_notes(
self,
Expand Down
2 changes: 1 addition & 1 deletion mipac/manager/admin/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def show_user(self, user_id: Optional[str] = None) -> UserDetailed:
auth=True,
lower=True,
)
return self.__client._modeler.create_user_instance(RawUser(res))
return UserDetailed(res, client=self.__client)

async def suspend(self, user_id: Optional[str] = None) -> bool:
"""
Expand Down

0 comments on commit 58eeb64

Please sign in to comment.