Skip to content

fix: update user's bool data and avatar #1404

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

Conversation

DylannCordel
Copy link
Contributor

Hi !

If we want to update email, avatar and do not send email confirmation change (skip_reconfirmation = True), MultipartEncoder will try to encode everything except None and bytes. So it tries to encode bools.

Casting bool's values to their stringified int representation fix it.

Exemple to reproduce it:

user.skip_reconfirmation = True
user.email = user_data['email']
user.avatar = b'\xff\xd8\xff\xdb\x00C\x00\x06\x04\x0...'
user.save()

If we want to update email, avatar and do not send email
confirmation change (`skip_reconfirmation` = True), `MultipartEncoder`
will try to encode everything except None and bytes. So it tries to encode bools.
Casting bool's values to their stringified int representation fix it.
Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

Thanks

@max-wittig
Copy link
Member

Thanks LGTM 👍

@max-wittig max-wittig merged commit 5fac07a into python-gitlab:master Apr 23, 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.

3 participants