Skip to content

Commit a673db8

Browse files
authored
Merge pull request #200 from mariuccio/master
'detail' keyword in success response messages
2 parents 592ea78 + f9b6a6c commit a673db8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

rest_auth/registration/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def post(self, request, *args, **kwargs):
7878
self.kwargs['key'] = serializer.validated_data['key']
7979
confirmation = self.get_object()
8080
confirmation.confirm(self.request)
81-
return Response({'message': _('ok')}, status=status.HTTP_200_OK)
81+
return Response({'detail': _('ok')}, status=status.HTTP_200_OK)
8282

8383

8484
class SocialLoginView(LoginView):

rest_auth/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def logout(self, request):
109109

110110
django_logout(request)
111111

112-
return Response({"success": _("Successfully logged out.")},
112+
return Response({"detail": _("Successfully logged out.")},
113113
status=status.HTTP_200_OK)
114114

115115

@@ -151,7 +151,7 @@ def post(self, request, *args, **kwargs):
151151
serializer.save()
152152
# Return the success message with OK HTTP status
153153
return Response(
154-
{"success": _("Password reset e-mail has been sent.")},
154+
{"detail": _("Password reset e-mail has been sent.")},
155155
status=status.HTTP_200_OK
156156
)
157157

@@ -173,7 +173,7 @@ def post(self, request):
173173
serializer = self.get_serializer(data=request.data)
174174
serializer.is_valid(raise_exception=True)
175175
serializer.save()
176-
return Response({"success": _("Password has been reset with the new password.")})
176+
return Response({"detail": _("Password has been reset with the new password.")})
177177

178178

179179
class PasswordChangeView(GenericAPIView):
@@ -191,4 +191,4 @@ def post(self, request):
191191
serializer = self.get_serializer(data=request.data)
192192
serializer.is_valid(raise_exception=True)
193193
serializer.save()
194-
return Response({"success": _("New password has been saved.")})
194+
return Response({"detail": _("New password has been saved.")})

0 commit comments

Comments
 (0)