Skip to content

Commit

Permalink
Merge pull request #192 from jqueuniet/fix_DetailEndpoint_create_data
Browse files Browse the repository at this point in the history
data argument on DetailEndpoint.create() is mandatory
  • Loading branch information
Zach Moody authored Nov 20, 2019
2 parents 6a9c5bd + 2718706 commit bc70a8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pynetbox/core/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def list(self, **kwargs):
)
return req

def create(self, data):
def create(self, data=None):
"""The write operation for a detail endpoint.
Creates objects on a detail endpoint in NetBox.
Expand All @@ -456,6 +456,8 @@ def create(self, data):
:returns: A dictionary or list of dictionaries its created in
NetBox.
"""
if not data:
return Request(**self.request_kwargs).post({})
return Request(**self.request_kwargs).post(data)


Expand Down

0 comments on commit bc70a8a

Please sign in to comment.