Skip to content

Commit f1858e4

Browse files
committed
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.
1 parent ba5edba commit f1858e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_auth/registration/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def post(self, request, *args, **kwargs):
6262

6363
def get_response(self):
6464
# serializer = self.user_serializer_class(instance=self.user)
65-
serializer = self.serializer_class(instance=self.token)
65+
serializer = self.serializer_class(instance=self.token,
66+
context={'request': self.request})
6667
return Response(serializer.data, status=status.HTTP_201_CREATED)
6768

6869
def get_response_with_errors(self):

0 commit comments

Comments
 (0)