Bypass AssertionErrors on nested Hyperlinked fields

Send request as context data to the UserDetailSerializer class, when
signing up. This way nested Hyperlinked serializer fields can be
correctly resolved.
This commit is contained in:
Karl Fleischmann 2015-10-28 00:55:08 +01:00
parent ba5edbaf62
commit f1858e4ce4

View File

@ -62,7 +62,8 @@ class RegisterView(APIView, SignupView):
def get_response(self):
# serializer = self.user_serializer_class(instance=self.user)
serializer = self.serializer_class(instance=self.token)
serializer = self.serializer_class(instance=self.token,
context={'request': self.request})
return Response(serializer.data, status=status.HTTP_201_CREATED)
def get_response_with_errors(self):