Skip to content

NoReverseMatch exception for plugins with models without *_list views #16825

Closed
@jsenecal

Description

@jsenecal

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

  1. Create a plugin with a model related to Core models.
  2. Create a set of views and urls for that model, without creating any _list views.
  3. Register that plugin in your netbox instance
  4. 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.

Metadata

Metadata

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtopic: pluginsRelates to the plugins frameworktype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions