diff --git a/src/accounts/api/views.py b/src/accounts/api/views.py index c472c8d..21aedc7 100644 --- a/src/accounts/api/views.py +++ b/src/accounts/api/views.py @@ -61,10 +61,11 @@ def get_post_response_data(self, request, token, instance): ) serializer = self.get_user_serializer_class() + data = { + "account": serializer(request.user, context=self.get_context()).data, + "token": token, + } - data = {"token": token} - if serializer is not None: - data["user"] = serializer(request.user, context=self.get_context()).data return data def get_user_serializer_class(self):