'detail' keyword in success response messages

This commit is contained in:
mariuccio 2016-03-31 10:58:14 +02:00
parent 49ccfe92a9
commit f9b6a6cd9f
2 changed files with 5 additions and 5 deletions

View File

@ -77,7 +77,7 @@ class VerifyEmailView(APIView, ConfirmEmailView):
self.kwargs['key'] = serializer.validated_data['key']
confirmation = self.get_object()
confirmation.confirm(self.request)
return Response({'message': _('ok')}, status=status.HTTP_200_OK)
return Response({'detail': _('ok')}, status=status.HTTP_200_OK)
class SocialLoginView(LoginView):

View File

@ -108,7 +108,7 @@ class LogoutView(APIView):
logout(request)
return Response({"success": _("Successfully logged out.")},
return Response({"detail": _("Successfully logged out.")},
status=status.HTTP_200_OK)
@ -149,7 +149,7 @@ class PasswordResetView(GenericAPIView):
serializer.save()
# Return the success message with OK HTTP status
return Response(
{"success": _("Password reset e-mail has been sent.")},
{"detail": _("Password reset e-mail has been sent.")},
status=status.HTTP_200_OK
)
@ -170,7 +170,7 @@ class PasswordResetConfirmView(GenericAPIView):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response({"success": _("Password has been reset with the new password.")})
return Response({"detail": _("Password has been reset with the new password.")})
class PasswordChangeView(GenericAPIView):
@ -188,4 +188,4 @@ class PasswordChangeView(GenericAPIView):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response({"success": _("New password has been saved.")})
return Response({"detail": _("New password has been saved.")})