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)