BaseException.message is removed in Python 3

This commit is contained in:
Alexandre Iooss 2021-05-05 19:12:23 +02:00
parent 93bc6bb245
commit 1ca5133026
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class AliasViewSet(ReadProtectedModelViewSet):
try:
self.perform_destroy(instance)
except ValidationError as e:
return Response({e.code: e.message}, status.HTTP_400_BAD_REQUEST)
return Response({e.code: str(e)}, status.HTTP_400_BAD_REQUEST)
return Response(status=status.HTTP_204_NO_CONTENT)
def get_queryset(self):