Skip to content

Commit b32ed25

Browse files
authored
Merge pull request #153 from netboxlabs/NPL-247-custom-fields2
NPL-247 fix custom fields referencing a custom object
2 parents 30bd7d2 + 78fb3f3 commit b32ed25

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

netbox_custom_objects/models.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,14 @@ def get_list_url(self):
136136
@classmethod
137137
def _get_viewname(cls, action=None, rest_api=False):
138138
if rest_api:
139-
return f"plugins-api:netbox_custom_objects:api:customobject_{action}"
139+
return f"plugins-api:netbox_custom_objects-api:customobject-{action}"
140140
return f"plugins:netbox_custom_objects:customobject_{action}"
141141

142142
@classmethod
143143
def _get_action_url(cls, action=None, rest_api=False, kwargs=None):
144-
if kwargs:
145-
kwargs["custom_object_type"] = cls.custom_object_type.name.lower()
144+
if kwargs is None:
145+
kwargs = {}
146+
kwargs["custom_object_type"] = cls.custom_object_type.name.lower()
146147
return reverse(cls._get_viewname(action, rest_api), kwargs=kwargs)
147148

148149

0 commit comments

Comments
 (0)