We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 34d6952 commit d4803f9Copy full SHA for d4803f9
gitlab.py
@@ -281,6 +281,10 @@ def create(self, obj):
281
url = obj._url % args
282
url = '%s%s' % (self._url, url)
283
284
+ for k, v in obj.__dict__.items():
285
+ if type(v) == bool:
286
+ obj.__dict__[k] = 1 if v else 0
287
+
288
try:
289
r = requests.post(url, obj.__dict__,
290
headers=self.headers,
@@ -304,8 +308,10 @@ def update(self, obj):
304
308
# build a dict of data that can really be sent to server
305
309
d = {}
306
310
for k, v in obj.__dict__.items():
307
- if type(v) in (int, str, bool):
311
+ if type(v) in (int, str):
312
d[k] = str(v)
313
+ elif type(v) == bool:
314
+ d[k] = 1 if v else 0
315
elif type(v) == unicode:
316
d[k] = str(v.encode(self.gitlab_encoding, "replace"))
317
0 commit comments