1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

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

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):