fix: update

This commit is contained in:
2026-05-17 15:00:23 +03:00
parent d3b5e0c107
commit 61e5a380e9
2 changed files with 10 additions and 2 deletions

View File

@@ -15,8 +15,12 @@ class DeleteAvatarCommand:
self._cache = cache
self._s3 = s3
@transactional
async def _load_user(self, user_id: str) -> UserEntity:
return await self._unit_of_work.user_repository.get_user_by_id(user_id)
async def __call__(self, user_id: str) -> UserEntity:
prior = await self._unit_of_work.user_repository.get_user_by_id(user_id)
prior = await self._load_user(user_id)
link = prior.avatar_link
if link:
key = self._s3.object_key_from_public_url(link)