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 market/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def get_service_option_image_upload_path(instance, filename):
) # market을 통해 reformer에 접근
market_uuid = instance.service_option.market_service.market.market_name
service_uuid = instance.service_option.market_service.service_uuid
option_uuid = instance.service_option.option_uuid
return f"users/{email_name}/market/{market_uuid}/service/{service_uuid}/option/{option_uuid}/{filename}"
return f"users/{email_name}/market/{market_uuid}/service/{service_uuid}/option/{filename}"


class Market(TimeStampedModel):
Expand Down
2 changes: 1 addition & 1 deletion market/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def upload_service_images(entity: Any, image_files) -> None:
@transaction.atomic
def upload_service_option_images(entity: Any, image_files) -> None:
"""
서비스 소개 이미지를 S3에 업로드 및 데이터베이스에 저장하는 함수
서비스 옵션 이미지를 S3에 업로드 및 데이터베이스에 저장하는 함수
"""
try:
# 파일 유효성 검증
Expand Down
4 changes: 2 additions & 2 deletions market/views/image_upload_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ServiceOptionImageUploadView(APIView):

@view_exception_handler
def post(self, request, **kwargs):
market_service_option = (
market_service_option: ServiceOption = (
ServiceOption.objects.filter(
market_service__market__market_uuid=kwargs.get("market_uuid"),
market_service__service_uuid=kwargs.get("service_uuid"),
Expand All @@ -91,7 +91,7 @@ def post(self, request, **kwargs):
if not market_service_option:
raise ObjectDoesNotExist("Cannot found service option with these uuids")

image_files = request.FILES.getlist(
image_files: List[Any] = request.FILES.getlist(
"option_image"
) # 이미지 파일 리스트를 request body에서 획득
if not image_files:
Expand Down
Loading