Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit c1e4a63

Browse files
authored
Fixed no content response for deletes (#14)
1 parent b265733 commit c1e4a63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

netbox_python/rest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ def request(self, method: str, path: str, **kwargs) -> Result:
7373

7474
# If status_code in 200-299 range, return success Result with data, otherwise raise exception
7575
is_success = 299 >= response.status_code >= 200 # 200 to 299 is OK
76+
no_content_success = response.status_code == 204 # 204 is OK. Means no content
7677
if is_success:
7778
# check if list - fixme: should have cleaner way to do this
7879
pagination = None
79-
if "count" in data_out and "results" in data_out:
80+
if not no_content_success and "count" in data_out and "results" in data_out:
8081
pagination = {
8182
"count": data_out.get("count"),
8283
"next": data_out.get("next"),

0 commit comments

Comments
 (0)