Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ba27ff

Browse files
committed
fix: update user's bool data and avatar
If we want to update email, avatar and do not send emailconfirmation 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.
1 parent60c5fd8 commit3ba27ff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎gitlab/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,12 @@ def http_request(
505505
json=None
506506
ifpost_dataisNone:
507507
post_data= {}
508+
else:
509+
# booleans does not exists for data (neither for MultipartEncoder):
510+
# cast to string int to avoid: 'bool' object has no attribute 'encode'
511+
fork,vinpost_data.items():
512+
ifisinstance(v,bool):
513+
post_data[k]=str(int(v))
508514
post_data["file"]=files.get("file")
509515
post_data["avatar"]=files.get("avatar")
510516
data=MultipartEncoder(post_data)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp