RecursionError when trying to call serialize_object() for a model which has m2m to DeviceType #13785
Replies: 3 comments 1 reply
-
@jeremystretch why did you convert this issue into a discussion? I insist that this is a bug and it prevents plugin developers from using very basic functionality like ManyToMany links to DeviceType. |
Beta Was this translation helpful? Give feedback.
-
@jeremystretch if you need it I can show you more sophisticated example of this error when plugin also contains views.py, forms.py, urls.py, etc. This recursion error happens when you're trying to create a model instance with m2m to DeviceType (the error happens when backend receives POST data from the form) |
Beta Was this translation helpful? Give feedback.
-
This seems a bit strange to me that just a m2m relationship to core NetBox model is not supported, but it's nice (at least for me) that core NetBox also has this m2m relationship to DeviceType and so this recursion problem can't just be ignored |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
NetBox version
v3.6.1
Python version
3.10
Steps to Reproduce
Expected Behavior
serialize_object(my_model) doesn't lead to
StackOverflowRecursionErrorObserved Behavior
RecursionError was raised.
As you know serialize_object() is called during form.save(). So this issue isn't just "theoretical"
Beta Was this translation helpful? Give feedback.
All reactions