summaryrefslogtreecommitdiff
path: root/gitlab/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-10-24 21:45:20 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2016-10-24 21:45:20 +0200
commit2c7a999f23b168f85c2b1c06296f617c626fde9d (patch)
treeaf94b65fe990b40d1ffd9ff29939014c4b88fd7a /gitlab/objects.py
parent62058f68dab820b04381c728f40d972eb60f6612 (diff)
downloadgitlab-2c7a999f23b168f85c2b1c06296f617c626fde9d.tar.gz
Don't overwrite attributes returned by the server
Fixes #171
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r--gitlab/objects.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index e95a894..e00a4ed 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -398,7 +398,9 @@ class GitlabObject(object):
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