-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass context to child serializer? #31
Comments
Very strange... I managed to have the expected result in my first query this morning, then everything falls apart in the EDIT : I can confirm that after a reboot I'm getting the expected result once and then it goes back to recursion error. In fact, if I kill the Python process and make another request, IIS creates another one and gives me the expected result, then subsequent requests end up in RecursionError. I never saw anything like that. Do you have any idea ? Maybe it has something to do with the process being kept alive ? |
Here are more insights: I tried creating a small test project to reproduce the issue using the example code I provided in the original post but I was unable to. Everything worked flawlessly using So I decided to give a try and spin up my dev environment with
|
Ok, I managed to track it down to a custom Here's a project that reproduces this issue: https://github.com/Crocmagnon/demo-recursion-error-drf-ff The culprit seems to be there: https://github.com/Crocmagnon/demo-recursion-error-drf-ff/blob/master/api/serializers.py#L22-L27 EDIT: |
I'm facing a RecursionError when querying a subset of fields that should not make recursion at all.
Here are some simplified models and serializers:
I queried my endpoint like this:
The expected result would be:
Instead, I'm getting a RecursionError (see below). Did I miss something ? I understand that since I'm requesting to expand the projects and the projects themselves have a reference to the clients, but given the
fields
input, I feel like this should not fall in recursion.The text was updated successfully, but these errors were encountered: