권주희

change the copied name in copy api

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