Closed
Description
Deployment Type
Self-hosted
NetBox Version
v4.0.6
Python Version
3.10
Steps to Reproduce
A bit complex, let me know if you really want me to go through a thorough plugin example
- Create a plugin with a model related to Core models.
- Create a set of views and urls for that model, without creating any
_list
views. - Register that plugin in your netbox instance
- Create and install required migrations
Expected Behavior
Related core model detail view should work as expected regardless of the missing _list
view in the plugin.
Observed Behavior
Bug Introduced by 5353f83
I have models with no *_list
views related to core models in my plugin and they get picked up by get_related_models
in GetRelatedModelsMixin
which raises a NoReverseMatch
exception in netbox/templates/inc/panels/related_objects.html
Technically get_related_models
has been designed with the idea that one can set the omit
method parameter to an iterable to avoid including these but there does not seem to have API which is exposed to plugin authors for Core models.