Merge pull request #200 from mariuccio/master

'detail' keyword in success response messages
This commit is contained in:
Maxim Kukhtenkov 2016-12-21 11:12:59 -08:00 committed by GitHub
commit a673db87f8
2 changed files with 5 additions and 5 deletions

View File

@ -78,7 +78,7 @@ class VerifyEmailView(APIView, ConfirmEmailView):
self.kwargs['key'] = serializer.validated_data['key'] self.kwargs['key'] = serializer.validated_data['key']
confirmation = self.get_object() confirmation = self.get_object()
confirmation.confirm(self.request) 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): class SocialLoginView(LoginView):

View File

@ -109,7 +109,7 @@ class LogoutView(APIView):
django_logout(request) django_logout(request)
return Response({"success": _("Successfully logged out.")}, return Response({"detail": _("Successfully logged out.")},
status=status.HTTP_200_OK) status=status.HTTP_200_OK)
@ -151,7 +151,7 @@ class PasswordResetView(GenericAPIView):
serializer.save() serializer.save()
# Return the success message with OK HTTP status # Return the success message with OK HTTP status
return Response( return Response(
{"success": _("Password reset e-mail has been sent.")}, {"detail": _("Password reset e-mail has been sent.")},
status=status.HTTP_200_OK status=status.HTTP_200_OK
) )
@ -173,7 +173,7 @@ class PasswordResetConfirmView(GenericAPIView):
serializer = self.get_serializer(data=request.data) serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True) serializer.is_valid(raise_exception=True)
serializer.save() 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): class PasswordChangeView(GenericAPIView):
@ -191,4 +191,4 @@ class PasswordChangeView(GenericAPIView):
serializer = self.get_serializer(data=request.data) serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True) serializer.is_valid(raise_exception=True)
serializer.save() serializer.save()
return Response({"success": _("New password has been saved.")}) return Response({"detail": _("New password has been saved.")})