Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/repository/user_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def create_kakao_user(self, kakao_profile: dict) -> User:
kakao_user = KakaoUser(
user_id=user.id,
nickname=kakao_profile["properties"]["nickname"],
### Profile image OT thumbnail..?
profile_photo=kakao_profile["properties"].get("profile_image")
profile_photo=None # No longer collecting profile images during user creation
)
self.db.add(kakao_user)
self.db.commit()
Expand Down
2 changes: 1 addition & 1 deletion src/service/travel_review_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_travel_review(self, travel_review_id: int) -> TravelReviewResponse:

def get_travel_review_list(self, user_id: int) -> List[TravelReviewListResponse]:
user_profile = self.user_repo.get_profile(user_id)
user_photo_url = self.s3_client.get_file(user_profile.profile_photo_key)
user_photo_url = self.s3_client.get_file(user_profile.profile_photo_key) if user_profile.profile_photo_key else None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

์ด ๋ณ€๊ฒฝ์œผ๋กœ user_photo_url์ด None์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ TravelReviewListResponse ์Šคํ‚ค๋งˆ์˜ user_photo ํ•„๋“œ๋Š” str ํƒ€์ž…์œผ๋กœ ์ •์˜๋˜์–ด ์žˆ์–ด None ๊ฐ’์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. (์ฐธ๊ณ : src/schema/travel_review_response.py์˜ 29๋ฒˆ์งธ ์ค„). ์ด๋กœ ์ธํ•ด profile_photo_key๊ฐ€ ์—†๋Š” ์‚ฌ์šฉ์ž์˜ ์—ฌํ–‰ ๋ฆฌ๋ทฐ ๋ชฉ๋ก์„ ์กฐํšŒํ•  ๋•Œ Pydantic ValidationError๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ API๊ฐ€ ์‹คํŒจํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด profile_photo_key๊ฐ€ ์—†์„ ๊ฒฝ์šฐ None ๋Œ€์‹  ๋นˆ ๋ฌธ์ž์—ด("")์„ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์Šคํ‚ค๋งˆ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ํ†ต๊ณผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜๋Š” ๊ทผ๋ณธ์ ์œผ๋กœ TravelReviewListResponse์˜ user_photo ํ•„๋“œ ํƒ€์ž…์„ Optional[str]๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ์„ ๊ณ ๋ คํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Suggested change
user_photo_url = self.s3_client.get_file(user_profile.profile_photo_key) if user_profile.profile_photo_key else None
user_photo_url = self.s3_client.get_file(user_profile.profile_photo_key) if user_profile.profile_photo_key else ""


travel_reviews = self.travel_review_repo.get_review_by_user_id(user_id)
result = []
Expand Down