Skip to content

Commit 5fac07a

Browse files
authored
Merge pull request #1404 from DylannCordel/fix-upd-user-bool-data-and-avatar
fix: update user's bool data and avatar
2 parents 711896f + 3ba27ff commit 5fac07a

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
if post_data is None:
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+
for k, v in post_data.items():
512+
if isinstance(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)