Skip to content

Commit 2c7a999

Browse files
author
Gauvain Pocentek
committed
Don't overwrite attributes returned by the server
Fixes #171
1 parent 62058f6 commit 2c7a999

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gitlab/objects.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@ def __init__(self, gl, data=None, **kwargs):
398398

399399
if kwargs:
400400
for k, v in kwargs.items():
401-
self.__dict__[k] = v
401+
# Don't overwrite attributes returned by the server (#171)
402+
if k not in self.__dict__ or not self.__dict__[k]:
403+
self.__dict__[k] = v
402404

403405
# Special handling for api-objects that don't have id-number in api
404406
# responses. Currently only Labels and Files

0 commit comments

Comments
 (0)