Skip to content

Commit f9b6a6c

Browse files
committed
'detail' keyword in success response messages
1 parent 49ccfe9 commit f9b6a6c

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
@@ -77,7 +77,7 @@ def post(self, request, *args, **kwargs):
7777
self.kwargs['key'] = serializer.validated_data['key']
7878
confirmation = self.get_object()
7979
confirmation.confirm(self.request)
80-
return Response({'message': _('ok')}, status=status.HTTP_200_OK)
80+
return Response({'detail': _('ok')}, status=status.HTTP_200_OK)
8181

8282

8383
class SocialLoginView(LoginView):

rest_auth/views.py

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

109109
logout(request)
110110

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

114114

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

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

175175

176176
class PasswordChangeView(GenericAPIView):
@@ -188,4 +188,4 @@ def post(self, request):
188188
serializer = self.get_serializer(data=request.data)
189189
serializer.is_valid(raise_exception=True)
190190
serializer.save()
191-
return Response({"success": _("New password has been saved.")})
191+
return Response({"detail": _("New password has been saved.")})

0 commit comments

Comments
 (0)