From 78fb3f354544017cc2b66edc9e23d33085550351 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 14 Aug 2025 11:47:31 -0700 Subject: [PATCH] NPL-247 fix custom fields referencing a custom object --- netbox_custom_objects/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/netbox_custom_objects/models.py b/netbox_custom_objects/models.py index 9788911..24ce8b5 100644 --- a/netbox_custom_objects/models.py +++ b/netbox_custom_objects/models.py @@ -136,13 +136,14 @@ def get_list_url(self): @classmethod def _get_viewname(cls, action=None, rest_api=False): if rest_api: - return f"plugins-api:netbox_custom_objects:api:customobject_{action}" + return f"plugins-api:netbox_custom_objects-api:customobject-{action}" return f"plugins:netbox_custom_objects:customobject_{action}" @classmethod def _get_action_url(cls, action=None, rest_api=False, kwargs=None): - if kwargs: - kwargs["custom_object_type"] = cls.custom_object_type.name.lower() + if kwargs is None: + kwargs = {} + kwargs["custom_object_type"] = cls.custom_object_type.name.lower() return reverse(cls._get_viewname(action, rest_api), kwargs=kwargs)