Skip to content

Commit

Permalink
Don't overwrite attributes returned by the server
Browse files Browse the repository at this point in the history
Fixes #171
  • Loading branch information
Gauvain Pocentek committed Oct 24, 2016
1 parent 62058f6 commit 2c7a999
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gitlab/objects.py
Expand Up @@ -398,7 +398,9 @@ def __init__(self, gl, data=None, **kwargs):

if kwargs:
for k, v in kwargs.items():
self.__dict__[k] = v
# Don't overwrite attributes returned by the server (#171)
if k not in self.__dict__ or not self.__dict__[k]:
self.__dict__[k] = v

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

0 comments on commit 2c7a999

Please sign in to comment.