권주희

change the copied name in copy api

......@@ -274,7 +274,8 @@ class ItemViewSet(viewsets.ViewSet):
return Response({'message': 'item is not existed.'}, status=status.HTTP_204_NO_CONTENT)
if child.is_folder == True:
return Response({'message': 'item is folder'}, status=status.HTTP_204_NO_CONTENT)
copiedName = child.name + "_복사본_" + str(datetime.now().strftime('%Y-%m-%d %H:%M'))
name = child.name.split(".")
copiedName = name[0]+ "_복사본_" + str(datetime.now().strftime('%Y-%m-%d %H:%M'))+"." + name[-1]
copiedItem = Item(is_folder=False, name=copiedName, path=child.path, parent=parent_id,
user_id=child.user_id, size=child.size, status=child.status)
copiedItem.save()
......