Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

markkuleinio
Copy link
Contributor

@markkuleinio markkuleinio commented May 2, 2023

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'>
>>>

@markkuleinio markkuleinio changed the title Fixes #465: permissions contraints handling in case of list of dicts Fix permissions contraints handling in case of list of dicts (fixes #465) May 2, 2023
Copy link
Contributor

@nautics889 nautics889 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked with netbox v3.5.2, LGTM

Copy link
Member

@abhi1693 abhi1693 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide a test case for this?

@abhi1693 abhi1693 merged commit a0da422 into netbox-community:master Aug 28, 2023
12 checks passed
@markkuleinio markkuleinio deleted the fix-constraints branch August 28, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Permission Constraints are handled as Records
3 participants