ChainedFieldsMixin fails to restrict queryset when form validation fails #3106
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Environment
Steps to Reproduce
Expected Behavior
The creation should fail and immediately return the form with the original data and a validation error.
Observed Behavior
NetBox takes a very long time to return the response. (With debugging enabled, it never returns.) I believe what's happening is that ChainedFieldsMixin is not filtering the queryset of the
nat_inside
field due to the failed form validation. This means the field is rendered with the querysetIPAddress.objects.all()
, which will take a long time to render when a large number of IPAddress objects exist.I still need to dig into this some more, but I wanted to make sure the bug was captured. We should also give some more though to how chained fields work in general now that the form widgets are all API-driven.
The text was updated successfully, but these errors were encountered: