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: #1671 Convert Python Bool to API Parameter for Authenticated User Notifications #2001

Merged
merged 2 commits into from Oct 11, 2021

Conversation

sshekdar-VMware
Copy link
Contributor

@sshekdar-VMware sshekdar-VMware commented Jul 21, 2021

Fixes #1671
Converts Python Bools all and participating to lower case string that are valid API parameters.
True is converted to "true"

if participating is not github.GithubObject.NotSet:
params["participating"] = participating
# convert True, False to true, false for api parameters
params["participating"] = str(participating).lower() if isinstance(participating, bool) else participating
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point, you know participating is set and is a bool, so I think you could be simplified to:

params["participating"] = "true" if participating else "false"

Copy link
Collaborator

Choose a reason for hiding this comment

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

And for all as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay sounds good. @s-t-e-v-e-n-k please review the change.

@sshekdar-VMware
Copy link
Contributor Author

@s-t-e-v-e-n-k

@sshekdar-VMware
Copy link
Contributor Author

@s-t-e-v-e-n-k could you please review and merge? Thank you.

@s-t-e-v-e-n-k s-t-e-v-e-n-k merged commit 1da600a into PyGithub:master Oct 11, 2021
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.

AuthenticatedUser.get_notifications() boolean query parameters always return true.
2 participants