Skip to content

Commit 3eff83c

Browse files
committed
remove except Exception
1 parent afdc9d4 commit 3eff83c

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

files/views.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ class FileView(generics.GenericAPIView):
1717
@transaction.atomic
1818
def post(self, request):
1919
"""creates a UserFile object and uploads the file to selectel"""
20-
try:
21-
file_api = FileAPI(request.FILES["file"], request.user)
22-
url = file_api.upload()
23-
return Response({"url": url}, status=status.HTTP_201_CREATED)
24-
except Exception as error:
25-
print(error)
26-
return Response("Failed to upload file", status=status.HTTP_409_CONFLICT)
20+
file_api = FileAPI(request.FILES["file"], request.user)
21+
url = file_api.upload()
22+
return Response({"url": url}, status=status.HTTP_201_CREATED)
2723

2824

2925
def delete(self, request, *args, **kwargs):

0 commit comments

Comments
 (0)