윤창목

Fixed key issue

......@@ -195,14 +195,14 @@ class ItemViewSet(viewsets.ViewSet):
s3_bucket = AWS_STORAGE_BUCKET_NAME
item = Item.objects.filter(item_id=pk)
object_id = item.get().item_id
object_name = item.get().name
data = serializers.serialize("json", item)
json_data = json.loads(data)
presigned_url = s3.generate_presigned_url(
'get_object',
Params={'Bucket': s3_bucket,
'Key': object_id},
'Key': object_name},
ExpiresIn=3600
)
......@@ -398,6 +398,7 @@ class ItemViewSet(viewsets.ViewSet):
# 파일 객체 생성
file_name = request.POST.get('name', '')
file_size = request.POST.get('size', '')
file_id = request.POST.get('item_id', '')
file_parent = pk
file_type = mimetypes.guess_type(file_name)[0]
upload_item = Item(name=file_name, size=file_size, user_id=1, file_type=file_type, parent=file_parent)
......