Skip to content

Commit

Permalink
Fix permissions contraints handling in case of list of dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
markkuleinio committed May 2, 2023
1 parent 53eaca6 commit 3743428
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pynetbox/core/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ def list_parser(key_name, list_item):
if len(v) and isinstance(v[0], dict) and "object_type" in v[0]:
v = [generic_list_parser(k, i) for i in v]
to_cache = list(v)
elif k == "constraints":
# Permissions constraints can be either dict or list
to_cache = copy.deepcopy(v)
else:
v = [list_parser(k, i) for i in v]
to_cache = list(v)
Expand Down

0 comments on commit 3743428

Please sign in to comment.