netbox-community / pynetbox

Python API client library for Netbox.
Apache License 2.0
543 stars 167 forks source link

Fix permissions contraints handling in case of list of dicts (fixes #465) #549

Closed markkuleinio closed 10 months ago

markkuleinio commented 1 year ago

Fixes #465

Before this fix:

>>> p = netbox.users.permissions.get(name="ViewSites")
>>> p.constraints
[{'status': 'active'}, {'region__name': 'Europe'}]
>>> type(p.constraints[0])
<class 'pynetbox.core.response.Record'>
>>>

After the fix:

>>> p = netbox.users.permissions.get(name="ViewSites")
>>> p.constraints
[{'status': 'active'}, {'region__name': 'Europe'}]
>>> type(p.constraints[0])
<class 'dict'>
>>>